summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-05-03 06:39:31 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-05-03 06:39:31 +0000
commit62f6586395e612102f14cfbf245d6b548a742bc2 (patch)
treed9977834ee380d9fc626694be3acdf0b810065f9 /Build/source/libs/freetype2/freetype-src/src
parent8c0da66823797139402fc59a01132e71b54e97e6 (diff)
freetype-1.10.0
git-svn-id: svn://tug.org/texlive/trunk@50966 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c52
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afangles.h6
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat18
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c190
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c42
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c87
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c181
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h238
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c246
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h44
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c147
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c175
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h42
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c88
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h36
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c152
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h105
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c61
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h252
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c54
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h36
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c33
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk3
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/Jamfile7
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/basepic.c108
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/basepic.h91
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftadvanc.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftapi.c121
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftbase.c36
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftbase.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftbbox.c356
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftbdf.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftbitmap.c369
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftcalc.c194
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftcid.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftcolor.c157
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftdbgmem.c60
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftdebug.c179
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/fterrors.c45
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftfntfmt.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftfstype.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftgasp.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftgloadr.c134
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftglyph.c141
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftgxval.c50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/fthash.c28
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftinit.c214
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c115
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftmac.c106
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftmm.c107
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c585
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftotval.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftoutln.c135
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftpatent.c34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftpfr.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftpic.c55
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftpsprop.c48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftrfork.c72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftsnames.c78
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftstream.c58
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftsynth.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftsystem.c281
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/fttrigon.c76
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/fttype1.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftutil.c54
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftver.rc10
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftwinfnt.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/rules.mk11
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bdf/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bdf/bdf.h76
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.c43
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.h9
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bdf/bdferror.h10
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bdf/bdflib.c192
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bzip2/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bzip2/ftbzip2.c52
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/bzip2/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcache.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcbasic.c36
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftccache.c34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftccache.h64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftccback.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftccmap.c62
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcerror.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.h166
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.h50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.c38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.h143
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.h80
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c92
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cff.c33
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.c35
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.c322
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cfferrs.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffgload.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffgload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffload.c61
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.c116
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffparse.c333
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffparse.h42
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffpic.c138
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cffpic.h121
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/cfftoken.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cff/rules.mk5
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/ciderrs.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidgload.c49
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidgload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidload.c185
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.c204
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.h116
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidparse.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidparse.h108
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidriver.c56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidriver.h38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/cidtoken.h57
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cid/type1cid.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/README2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.c34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.h50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvbsln.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.c68
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.h60
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxverror.h66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.h50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfgen.c114
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvjust.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvkern.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvlcar.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.h56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.c65
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.h50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort0.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort1.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort2.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort4.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort5.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.h50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx0.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx1.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx2.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx4.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx5.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvopbd.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvprop.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvtrak.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gxvalid/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gzip/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c62
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/gzip/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/lzw/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/lzw/ftlzw.c56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.c48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.h116
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/lzw/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvbase.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otverror.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvgdef.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvgsub.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvjstf.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvmath.c50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.h38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/otvalid/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcf.h56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c163
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.h5
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcferror.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c293
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcfutil.c6
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfr.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.c48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.h38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrerror.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.c52
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.c162
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.c38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.c34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/pfrtypes.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pfr/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c300
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h36
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c100
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psblues.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/pserror.c72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/pserror.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psfixed.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psfont.c76
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psfont.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psft.c95
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psft.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psglue.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c117
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/pshints.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c148
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c478
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psread.c74
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psread.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c75
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/psstack.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/pstypes.h72
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c35
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c341
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.c50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.c39
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.h68
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshinter.c33
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.c35
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshnterr.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.c76
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.h63
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.c38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.h56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pshinter/rules.mk3
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c73
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/psnamerr.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/psnames.c33
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/pspic.c97
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/pspic.h68
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/pstables.h44
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/rules.mk21
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/ftmisc.h50
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/ftraster.c1213
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/ftraster.h42
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.c41
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/raster.c33
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/rasterrs.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/rastpic.c89
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/rastpic.h63
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/raster/rules.mk5
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/Jamfile4
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/rules.mk21
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.c241
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sferrors.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfnt.c36
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.c143
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.h112
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c255
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.c54
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.c651
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.h70
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmapc.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.c451
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.h58
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.c311
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.h49
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.c56
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.c569
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.c181
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.c117
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.c64
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.c451
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.h49
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftsmerrs.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.c125
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.c118
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.h75
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/rules.mk5
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/smooth/smooth.c33
-rwxr-xr-xBuild/source/libs/freetype2/freetype-src/src/tools/afblue.pl2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/content.py672
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docbeauty.py111
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docmaker.py115
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/formatter.py228
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/sources.py410
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/tohtml.py725
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/docmaker/utils.py127
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/README81
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftfuzzer.cc428
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftmutator.cc314
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/rasterfuzzer.cc129
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/runinput.cc58
-rwxr-xr-xBuild/source/libs/freetype2/freetype-src/src/tools/glnames.py50
-rwxr-xr-xBuild/source/libs/freetype2/freetype-src/src/tools/update-copyright-year19
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/rules.mk3
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/truetype.c33
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.c224
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.h34
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/tterrors.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.c432
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.c1364
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.h312
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c3262
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.h168
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.c464
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.h312
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.c101
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.h88
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.c238
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.c90
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.h52
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1afm.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c213
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1driver.h38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1errors.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1gload.c77
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1gload.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1load.c420
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1load.h42
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1objs.c213
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1objs.h132
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c110
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1parse.h101
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1tokens.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/type1.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.c82
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.h38
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42error.h46
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42objs.c66
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42objs.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42parse.c87
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42parse.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/t42types.h32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type42/type42.c32
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/Jamfile2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/fnterrs.h48
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/module.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/rules.mk2
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c58
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.h40
431 files changed, 18083 insertions, 21090 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/Jamfile b/Build/source/libs/freetype2/freetype-src/src/Jamfile
index 562480c94a1..3ad2d5c9622 100644
--- a/Build/source/libs/freetype2/freetype-src/src/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile b/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile
index 01b866ec61a..ea69dee3776 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/autofit Jamfile
#
-# Copyright 2003-2018 by
+# Copyright (C) 2003-2019 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/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c
index c65a3ae23e9..9e1f7a21ffd 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* afangles.c */
-/* */
-/* Routines used to compute vector angles with limited accuracy */
-/* and very high speed. It also contains sorting routines (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afangles.c
+ *
+ * Routines used to compute vector angles with limited accuracy
+ * and very high speed. It also contains sorting routines (body).
+ *
+ * Copyright (C) 2003-2019 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...
+ * We are not using `af_angle_atan' anymore, but we keep the source
+ * code below just in case...
*/
@@ -30,16 +30,16 @@
/*
- * 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 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
+ * The approximation
*
- * dy * PI / (|dx|+|dy|)
+ * dy * PI / (|dx|+|dy|)
*
- * should be enough, and much faster to compute.
+ * should be enough, and much faster to compute.
*/
FT_LOCAL_DEF( AF_Angle )
af_angle_atan( FT_Fixed dx,
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.h
index f33f9e108e3..18d7dae3a6b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.h
@@ -1,7 +1,7 @@
/*
- * afangles.h
+ * afangles.h
*
- * This is a dummy file, used to please the build system. It is never
- * included by the auto-fitter sources.
+ * This is a dummy file, used to please the build system. It is never
+ * included by the auto-fitter sources.
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c
index e4078fd0444..28da159008e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c
@@ -1,22 +1,22 @@
/* This file has been generated by the Perl script `afblue.pl', */
/* using data from file `afblue.dat'. */
-/***************************************************************************/
-/* */
-/* afblue.c */
-/* */
-/* Auto-fitter data for blue strings (body). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afblue.c
+ *
+ * Auto-fitter data for blue strings (body).
+ *
+ * Copyright (C) 2013-2019 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"
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin
index 4913e2eb6f2..6545d1fd433 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afblue.c */
-/* */
-/* Auto-fitter data for blue strings (body). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afblue.c
+ *
+ * Auto-fitter data for blue strings (body).
+ *
+ * Copyright (C) 2013-2019 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"
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat
index bc2f0d27540..14a0993b61d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat
@@ -1,15 +1,15 @@
-// afblue.dat
+// afblue.dat
//
-// Auto-fitter data for blue strings.
+// Auto-fitter data for blue strings.
//
-// Copyright 2013-2018 by
-// David Turner, Robert Wilhelm, and Werner Lemberg.
+// Copyright (C) 2013-2019 by
+// David Turner, Robert Wilhelm, and Werner Lemberg.
//
-// This file is part of the FreeType project, and may only be used,
-// modified, and distributed under the terms of the FreeType project
-// license, LICENSE.TXT. By continuing to use, modify, or distribute
-// this file you indicate that you have read the license and
-// understand and accept it fully.
+// This file is part of the FreeType project, and may only be used,
+// modified, and distributed under the terms of the FreeType project
+// license, LICENSE.TXT. By continuing to use, modify, or distribute
+// this file you indicate that you have read the license and
+// understand and accept it fully.
// This file contains data specific to blue zones. It gets processed by
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h
index de31e259c3b..a2ff597b8eb 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h
@@ -1,22 +1,22 @@
/* This file has been generated by the Perl script `afblue.pl', */
/* using data from file `afblue.dat'. */
-/***************************************************************************/
-/* */
-/* afblue.h */
-/* */
-/* Auto-fitter data for blue strings (specification). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afblue.h
+ *
+ * Auto-fitter data for blue strings (specification).
+ *
+ * Copyright (C) 2013-2019 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 AFBLUE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin
index 682147cb30d..30a28dafa53 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afblue.h */
-/* */
-/* Auto-fitter data for blue strings (specification). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afblue.h
+ *
+ * Auto-fitter data for blue strings (specification).
+ *
+ * Copyright (C) 2013-2019 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 AFBLUE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c
index 21b6bffa332..3b2b1cf24ce 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c
@@ -1,24 +1,24 @@
-/***************************************************************************/
-/* */
-/* afcjk.c */
-/* */
-/* Auto-fitter hinting routines for CJK writing system (body). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afcjk.c
+ *
+ * Auto-fitter hinting routines for CJK writing system (body).
+ *
+ * Copyright (C) 2006-2019 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 algorithm is based on akito's autohint patch, archived at
+ * The algorithm is based on akito's autohint patch, archived at
*
- * https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
+ * https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
*
*/
@@ -27,7 +27,6 @@
#include FT_INTERNAL_DEBUG_H
#include "afglobal.h"
-#include "afpic.h"
#include "aflatin.h"
#include "afcjk.h"
@@ -44,14 +43,14 @@
#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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_afcjk
+#define FT_COMPONENT afcjk
/*************************************************************************/
@@ -92,23 +91,29 @@
AF_CJKMetricsRec dummy[1];
AF_Scaler scaler = &dummy->root.scaler;
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = metrics->root.globals;
-#endif
-
AF_StyleClass style_class = metrics->root.style_class;
- AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
- [style_class->script];
+ AF_ScriptClass script_class = af_script_classes[style_class->script];
+
+ /* If HarfBuzz is not available, we need a pointer to a single */
+ /* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
+ FT_ULong shaper_buf_;
+ void* shaper_buf = &shaper_buf_;
+#endif
- void* shaper_buf;
const char* p;
#ifdef FT_DEBUG_LEVEL_TRACE
FT_ULong ch = 0;
#endif
- p = script_class->standard_charstring;
+ p = script_class->standard_charstring;
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
shaper_buf = af_shaper_buf_create( face );
+#endif
/* We check a list of standard characters. The first match wins. */
@@ -193,10 +198,10 @@
goto Exit;
/*
- * We assume that the glyphs selected for the stem width
- * computation are `featureless' enough so that the linking
- * algorithm works fine without adjustments of its scoring
- * function.
+ * We assume that the glyphs selected for the stem width
+ * computation are `featureless' enough so that the linking
+ * algorithm works fine without adjustments of its scoring
+ * function.
*/
af_latin_hints_link_segments( hints,
0,
@@ -296,7 +301,14 @@
AF_Blue_Stringset bss = sc->blue_stringset;
const AF_Blue_StringRec* bs = &af_blue_stringsets[bss];
- void* shaper_buf;
+ /* If HarfBuzz is not available, we need a pointer to a single */
+ /* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
+ FT_ULong shaper_buf_;
+ void* shaper_buf = &shaper_buf_;
+#endif
/* we walk over the blue character strings as specified in the */
@@ -307,7 +319,9 @@
"==========================\n"
"\n" ));
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
shaper_buf = af_shaper_buf_create( face );
+#endif
for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
{
@@ -483,8 +497,8 @@
if ( num_flats == 0 && num_fills == 0 )
{
/*
- * we couldn't find a single glyph to compute this blue zone,
- * we will simply ignore it then
+ * we couldn't find a single glyph to compute this blue zone,
+ * we will simply ignore it then
*/
FT_TRACE5(( " empty\n" ));
continue;
@@ -565,15 +579,25 @@
FT_Bool started = 0, same_width = 1;
FT_Fixed advance = 0, old_advance = 0;
- void* shaper_buf;
+ /* If HarfBuzz is not available, we need a pointer to a single */
+ /* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
+ FT_ULong shaper_buf_;
+ void* shaper_buf = &shaper_buf_;
+#endif
/* in all supported charmaps, digits have character codes 0x30-0x39 */
const char digits[] = "0 1 2 3 4 5 6 7 8 9";
const char* p;
- p = digits;
+ p = digits;
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
shaper_buf = af_shaper_buf_create( face );
+#endif
while ( *p )
{
@@ -890,11 +914,11 @@
}
/*
- * now compute the `serif' segments
+ * now compute the `serif' segments
*
- * In Hanzi, some strokes are wider on one or both of the ends.
- * We either identify the stems on the ends as serifs or remove
- * the linkage, depending on the length of the stems.
+ * In Hanzi, some strokes are wider on one or both of the ends.
+ * We either identify the stems on the ends as serifs or remove
+ * the linkage, depending on the length of the stems.
*
*/
@@ -1000,21 +1024,21 @@
scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
: hints->y_scale;
- /*********************************************************************/
- /* */
- /* We 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 is then processed in the second step to compute the */
- /* edge's properties. */
- /* */
- /* Note that the edges table is sorted along the segment/edge */
- /* position. */
- /* */
- /*********************************************************************/
+ /**********************************************************************
+ *
+ * We 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 is then 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 );
@@ -1114,17 +1138,17 @@
}
}
- /******************************************************************/
- /* */
- /* Good, we now compute each edge's properties according to the */
- /* segments found on its position. Basically, these are */
- /* */
- /* - the 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 */
- /* */
- /******************************************************************/
+ /*******************************************************************
+ *
+ * Good, we now compute each edge's properties according to the
+ * segments found on its position. Basically, these are
+ *
+ * - the 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 */
@@ -1174,7 +1198,7 @@
/* check for links -- if seg->serif is set, then seg->link must */
/* be ignored */
- is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge );
+ is_serif = FT_BOOL( seg->serif && seg->serif->edge != edge );
if ( seg->link || is_serif )
{
@@ -1364,8 +1388,8 @@
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
/*
- * correct x_scale and y_scale when needed, since they may have
- * been modified af_cjk_scale_dim above
+ * correct x_scale and y_scale when needed, since they may have
+ * been modified af_cjk_scale_dim above
*/
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
@@ -1384,21 +1408,21 @@
other_flags = 0;
/*
- * We snap the width of vertical stems for the monochrome and
- * horizontal LCD rendering targets only.
+ * 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.
+ * 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.
+ * 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;
@@ -2094,8 +2118,8 @@
goto Exit;
/*
- * now hint the remaining edges (serifs and single) in order
- * to complete our processing
+ * now hint the remaining edges (serifs and single) in order
+ * to complete our processing
*/
for ( edge = edges; edge < edge_limit; edge++ )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h
index d229c0c9cff..59acae53429 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afcjk.h */
-/* */
-/* Auto-fitter hinting routines for CJK writing system (specification). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afcjk.h
+ *
+ * Auto-fitter hinting routines for CJK writing system (specification).
+ *
+ * Copyright (C) 2006-2019 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 AFCJK_H_
@@ -41,9 +41,9 @@ FT_BEGIN_HEADER
/*
- * CJK glyphs tend to fill the square. So we have both vertical and
- * horizontal blue zones. But some glyphs have flat bounding strokes that
- * leave some space between neighbour glyphs.
+ * CJK glyphs tend to fill the square. So we have both vertical and
+ * horizontal blue zones. But some glyphs have flat bounding strokes that
+ * leave some space between neighbour glyphs.
*/
#define AF_CJK_IS_TOP_BLUE( b ) \
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h
index 6eeb8fc9fb7..ff207a97e08 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afcover.h */
-/* */
-/* Auto-fitter coverages (specification only). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afcover.h
+ *
+ * Auto-fitter coverages (specification only).
+ *
+ * Copyright (C) 2013-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
/* This header file can be included multiple times. */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c
index f30c517cbb3..7e07a41e7da 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* afdummy.c */
-/* */
-/* Auto-fitter dummy routines to be used if no hinting should be */
-/* performed (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afdummy.c
+ *
+ * Auto-fitter dummy routines to be used if no hinting should be
+ * performed (body).
+ *
+ * Copyright (C) 2003-2019 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 "afdummy.h"
@@ -38,13 +38,15 @@
static FT_Error
- af_dummy_hints_apply( FT_UInt glyph_index,
- AF_GlyphHints hints,
- FT_Outline* outline )
+ af_dummy_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
+ FT_Outline* outline,
+ AF_StyleMetrics metrics )
{
FT_Error error;
FT_UNUSED( glyph_index );
+ FT_UNUSED( metrics );
error = af_glyph_hints_reload( hints, outline );
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h
index b382acd92ae..ab9227d35d9 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* afdummy.h */
-/* */
-/* Auto-fitter dummy routines to be used if no hinting should be */
-/* performed (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afdummy.h
+ *
+ * Auto-fitter dummy routines to be used if no hinting should be
+ * performed (specification).
+ *
+ * Copyright (C) 2003-2019 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 AFDUMMY_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h
index e5de54360f7..2ec336f72c6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* aferrors.h */
-/* */
-/* Autofitter error codes (specification only). */
-/* */
-/* Copyright 2005-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the Autofitter error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * aferrors.h
+ *
+ * Autofitter error codes (specification only).
+ *
+ * Copyright (C) 2005-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the Autofitter error enumeration
+ * constants.
+ *
+ */
#ifndef AFERRORS_H_
#define AFERRORS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c
index 3d09c53e8a0..7183ce4a780 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afglobal.c */
-/* */
-/* Auto-fitter routines to compute global hinting values (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afglobal.c
+ *
+ * Auto-fitter routines to compute global hinting values (body).
+ *
+ * Copyright (C) 2003-2019 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 "afglobal.h"
@@ -22,14 +22,14 @@
#include FT_INTERNAL_DEBUG_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_afglobal
+#define FT_COMPONENT afglobal
/* get writing system specific header files */
@@ -38,7 +38,6 @@
#include "afwrtsys.h"
#include "aferrors.h"
-#include "afpic.h"
#undef SCRIPT
@@ -67,8 +66,6 @@
#include "afstyles.h"
-#ifndef FT_CONFIG_OPTION_PIC
-
#undef WRITING_SYSTEM
#define WRITING_SYSTEM( ws, WS ) \
&af_ ## ws ## _writing_system_class,
@@ -110,8 +107,6 @@
NULL /* do not remove */
};
-#endif /* !FT_CONFIG_OPTION_PIC */
-
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -159,12 +154,12 @@
}
/* scan each style in a Unicode charmap */
- for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+ for ( ss = 0; af_style_classes[ss]; ss++ )
{
AF_StyleClass style_class =
- AF_STYLE_CLASSES_GET[ss];
+ af_style_classes[ss];
AF_ScriptClass script_class =
- AF_SCRIPT_CLASSES_GET[style_class->script];
+ af_script_classes[style_class->script];
AF_Script_UniRange range;
@@ -172,8 +167,8 @@
continue;
/*
- * Scan all Unicode points in the range and set the corresponding
- * glyph style index.
+ * Scan all Unicode points in the range and set the corresponding
+ * glyph style index.
*/
if ( style_class->coverage == AF_COVERAGE_DEFAULT )
{
@@ -246,9 +241,9 @@
}
/* handle the remaining default OpenType features ... */
- for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+ for ( ss = 0; af_style_classes[ss]; ss++ )
{
- AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
+ AF_StyleClass style_class = af_style_classes[ss];
if ( style_class->coverage == AF_COVERAGE_DEFAULT )
@@ -256,7 +251,7 @@
}
/* ... and finally the default OpenType features of the default script */
- af_shaper_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles, 1 );
+ af_shaper_get_coverage( globals, af_style_classes[dflt], gstyles, 1 );
/* mark ASCII digits */
for ( i = 0x30; i <= 0x39; i++ )
@@ -270,8 +265,8 @@
Exit:
/*
- * By default, all uncovered glyphs are set to the fallback style.
- * XXX: Shouldn't we disable hinting or do something similar?
+ * By default, all uncovered glyphs are set to the fallback style.
+ * XXX: Shouldn't we disable hinting or do something similar?
*/
if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED )
{
@@ -295,9 +290,9 @@
"==============\n"
"\n" ));
- for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+ for ( ss = 0; af_style_classes[ss]; ss++ )
{
- AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
+ AF_StyleClass style_class = af_style_classes[ss];
FT_UInt count = 0;
FT_Long idx;
@@ -397,9 +392,9 @@
if ( globals->metrics[nn] )
{
AF_StyleClass style_class =
- AF_STYLE_CLASSES_GET[nn];
+ af_style_classes[nn];
AF_WritingSystemClass writing_system_class =
- AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
+ af_writing_system_classes[style_class->writing_system];
if ( writing_system_class->style_metrics_done )
@@ -448,8 +443,8 @@
style = (AF_Style)( globals->glyph_styles[gindex] &
AF_STYLE_UNASSIGNED );
- style_class = AF_STYLE_CLASSES_GET[style];
- writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET
+ style_class = af_style_classes[style];
+ writing_system_class = af_writing_system_classes
[style_class->writing_system];
metrics = globals->metrics[style];
@@ -494,9 +489,9 @@
FT_UInt gindex )
{
if ( gindex < (FT_ULong)globals->glyph_count )
- return (FT_Bool)( globals->glyph_styles[gindex] & AF_DIGIT );
+ return FT_BOOL( globals->glyph_styles[gindex] & AF_DIGIT );
- return (FT_Bool)0;
+ return FT_BOOL( 0 );
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h
index 489ed46d9ee..52f38350db3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* afglobal.h */
-/* */
-/* Auto-fitter routines to compute global hinting values */
-/* (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afglobal.h
+ *
+ * Auto-fitter routines to compute global hinting values
+ * (specification).
+ *
+ * Copyright (C) 2003-2019 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 AFGLOBAL_H_
@@ -60,8 +60,8 @@ FT_BEGIN_HEADER
/*
- * Default values and flags for both autofitter globals (found in
- * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
+ * Default values and flags for both autofitter globals (found in
+ * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
*/
/* index of fallback style in `af_style_classes' */
@@ -98,8 +98,8 @@ FT_BEGIN_HEADER
/*
- * Note that glyph_styles[] maps each glyph to an index into the
- * `af_style_classes' array.
+ * Note that glyph_styles[] maps each glyph to an index into the
+ * `af_style_classes' array.
*
*/
typedef struct AF_FaceGlobalsRec_
@@ -140,8 +140,8 @@ FT_BEGIN_HEADER
/*
- * model the global hints data for a given face, decomposed into
- * style-specific items
+ * model the global hints data for a given face, decomposed into
+ * style-specific items
*/
FT_LOCAL( FT_Error )
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c
index 0666dbc8e20..ed111c41176 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afhints.c */
-/* */
-/* Auto-fitter hinting routines (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afhints.c
+ *
+ * Auto-fitter hinting routines (body).
+ *
+ * Copyright (C) 2003-2019 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 "afhints.h"
@@ -22,14 +22,14 @@
#include FT_INTERNAL_DEBUG_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_afhints
+#define FT_COMPONENT afhints
/* Get new segment for given axis. */
@@ -297,6 +297,19 @@
}
+ static int
+ af_get_strong_edge_index( AF_GlyphHints hints,
+ AF_Edge* strong_edges,
+ int dimension )
+ {
+ AF_AxisHints axis = &hints->axis[dimension];
+ AF_Edge edges = axis->edges;
+
+
+ return AF_INDEX_NUM( strong_edges[dimension], edges );
+ }
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -317,8 +330,10 @@
{
AF_DUMP(( " index hedge hseg vedge vseg flags "
/* " XXXXX XXXXX XXXXX XXXXX XXXXX XXXXXX" */
- " xorg yorg xscale yscale xfit yfit" ));
+ " xorg yorg xscale yscale xfit yfit "
/* " XXXXX XXXXX XXXX.XX XXXX.XX XXXX.XX XXXX.XX" */
+ " hbef haft vbef vaft" ));
+ /* " XXXXX XXXXX XXXXX XXXXX" */
}
else
AF_DUMP(( " (none)\n" ));
@@ -330,6 +345,7 @@
int segment_idx_1 = af_get_segment_index( hints, point_idx, 1 );
char buf1[16], buf2[16], buf3[16], buf4[16];
+ char buf5[16], buf6[16], buf7[16], buf8[16];
/* insert extra newline at the beginning of a contour */
@@ -340,7 +356,8 @@
}
AF_DUMP(( " %5d %5s %5s %5s %5s %s"
- " %5d %5d %7.2f %7.2f %7.2f %7.2f\n",
+ " %5d %5d %7.2f %7.2f %7.2f %7.2f"
+ " %5s %5s %5s %5s\n",
point_idx,
af_print_idx( buf1,
af_get_edge_index( hints, segment_idx_1, 1 ) ),
@@ -359,7 +376,20 @@
point->ox / 64.0,
point->oy / 64.0,
point->x / 64.0,
- point->y / 64.0 ));
+ point->y / 64.0,
+
+ af_print_idx( buf5, af_get_strong_edge_index( hints,
+ point->before,
+ 1 ) ),
+ af_print_idx( buf6, af_get_strong_edge_index( hints,
+ point->after,
+ 1 ) ),
+ af_print_idx( buf7, af_get_strong_edge_index( hints,
+ point->before,
+ 0 ) ),
+ af_print_idx( buf8, af_get_strong_edge_index( hints,
+ point->after,
+ 0 ) ) ));
}
AF_DUMP(( "\n" ));
}
@@ -519,7 +549,7 @@
*offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->fx
: seg->first->fy;
if ( seg->edge )
- *is_blue = (FT_Bool)( seg->edge->blue_edge != 0 );
+ *is_blue = FT_BOOL( seg->edge->blue_edge );
else
*is_blue = FALSE;
@@ -558,8 +588,8 @@
/*
- * note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
- * since they have a constant X coordinate.
+ * note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
+ * since they have a constant X coordinate.
*/
if ( dimension == AF_DIMENSION_HORZ )
AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n",
@@ -681,8 +711,8 @@
memory = hints->memory;
/*
- * note that we don't need to free the segment and edge
- * buffers since they are really within the hints->points array
+ * note that we don't need to free the segment and edge
+ * buffers since they are really within the hints->points array
*/
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
{
@@ -776,9 +806,9 @@
}
/*
- * then reallocate the points arrays if necessary --
- * note that we reserve two additional point positions, used to
- * hint metrics appropriately
+ * then reallocate the points arrays if necessary --
+ * note that we reserve two additional point positions, used to
+ * hint metrics appropriately
*/
new_max = (FT_UInt)( outline->n_points + 2 );
old_max = (FT_UInt)hints->max_points;
@@ -898,6 +928,14 @@
prev = end;
}
}
+
+#ifdef FT_DEBUG_AUTOFIT
+ point->before[0] = NULL;
+ point->before[1] = NULL;
+ point->after[0] = NULL;
+ point->after[1] = NULL;
+#endif
+
}
}
@@ -918,15 +956,15 @@
{
/*
- * Compute directions of `in' and `out' vectors.
+ * Compute directions of `in' and `out' vectors.
*
- * Note that distances between points that are very near to each
- * other are accumulated. In other words, the auto-hinter either
- * prepends the small vectors between near points to the first
- * non-near vector, or the sum of small vector lengths exceeds a
- * threshold, thus `grouping' the small vectors. All intermediate
- * points are tagged as weak; the directions are adjusted also to
- * be equal to the accumulated one.
+ * Note that distances between points that are very near to each
+ * other are accumulated. In other words, the auto-hinter either
+ * prepends the small vectors between near points to the first
+ * non-near vector, or the sum of small vector lengths exceeds a
+ * threshold, thus `grouping' the small vectors. All intermediate
+ * points are tagged as weak; the directions are adjusted also to
+ * be equal to the accumulated one.
*/
FT_Int near_limit2 = 2 * near_limit - 1;
@@ -956,12 +994,12 @@
out_y = point->fy - prev->fy;
/*
- * We use Taxicab metrics to measure the vector length.
+ * We use Taxicab metrics to measure the vector length.
*
- * Note that the accumulated distances so far could have the
- * opposite direction of the distance measured here. For this
- * reason we use `near_limit2' for the comparison to get a
- * non-near point even in the worst case.
+ * Note that the accumulated distances so far could have the
+ * opposite direction of the distance measured here. For this
+ * reason we use `near_limit2' for the comparison to get a
+ * non-near point even in the worst case.
*/
if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 )
break;
@@ -979,11 +1017,11 @@
curr = first;
/*
- * We abuse the `u' and `v' fields to store index deltas to the
- * next and previous non-near point, respectively.
+ * We abuse the `u' and `v' fields to store index deltas to the
+ * next and previous non-near point, respectively.
*
- * To avoid problems with not having non-near points, we point to
- * `first' by default as the next non-near point.
+ * To avoid problems with not having non-near points, we point to
+ * `first' by default as the next non-near point.
*
*/
curr->u = (FT_Pos)( first - curr );
@@ -1035,12 +1073,12 @@
}
/*
- * The next step is to `simplify' an outline's topology so that we
- * can identify local extrema more reliably: A series of
- * non-horizontal or non-vertical vectors pointing into the same
- * quadrant are handled as a single, long vector. From a
- * topological point of the view, the intermediate points are of no
- * interest and thus tagged as weak.
+ * The next step is to `simplify' an outline's topology so that we
+ * can identify local extrema more reliably: A series of
+ * non-horizontal or non-vertical vectors pointing into the same
+ * quadrant are handled as a single, long vector. From a
+ * topological point of the view, the intermediate points are of no
+ * interest and thus tagged as weak.
*/
for ( point = points; point < point_limit; point++ )
@@ -1080,9 +1118,9 @@
}
/*
- * Finally, check for remaining weak points. Everything else not
- * collected in edges so far is then implicitly classified as strong
- * points.
+ * Finally, check for remaining weak points. Everything else not
+ * collected in edges so far is then implicitly classified as strong
+ * points.
*/
for ( point = points; point < point_limit; point++ )
@@ -1309,6 +1347,12 @@
if ( delta >= 0 )
{
u = edge->pos - ( edge->opos - ou );
+
+#ifdef FT_DEBUG_AUTOFIT
+ point->before[dim] = edge;
+ point->after[dim] = NULL;
+#endif
+
goto Store_Point;
}
@@ -1318,6 +1362,12 @@
if ( delta >= 0 )
{
u = edge->pos + ( ou - edge->opos );
+
+#ifdef FT_DEBUG_AUTOFIT
+ point->before[dim] = NULL;
+ point->after[dim] = edge;
+#endif
+
goto Store_Point;
}
@@ -1364,6 +1414,12 @@
{
/* we are on the edge */
u = edge->pos;
+
+#ifdef FT_DEBUG_AUTOFIT
+ point->before[dim] = NULL;
+ point->after[dim] = NULL;
+#endif
+
goto Store_Point;
}
}
@@ -1374,6 +1430,11 @@
AF_Edge after = edges + min + 0;
+#ifdef FT_DEBUG_AUTOFIT
+ point->before[dim] = before;
+ point->after[dim] = after;
+#endif
+
/* assert( before && after && before != after ) */
if ( before->scale == 0 )
before->scale = FT_DivFix( after->pos - before->pos,
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h
index 3326ebc44e7..e0cf612f0c5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afhints.h */
-/* */
-/* Auto-fitter hinting routines (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afhints.h
+ *
+ * Auto-fitter hinting routines (specification).
+ *
+ * Copyright (C) 2003-2019 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 AFHINTS_H_
@@ -26,8 +26,8 @@
FT_BEGIN_HEADER
/*
- * The definition of outline glyph hints. These are shared by all
- * writing system analysis routines (until now).
+ * The definition of outline glyph hints. These are shared by all
+ * writing system analysis routines (until now).
*/
typedef enum AF_Dimension_
@@ -56,153 +56,153 @@ FT_BEGIN_HEADER
/*
- * The following explanations are mostly taken from the article
+ * The following explanations are mostly taken from the article
*
- * Real-Time Grid Fitting of Typographic Outlines
+ * Real-Time Grid Fitting of Typographic Outlines
*
- * by David Turner and Werner Lemberg
+ * by David Turner and Werner Lemberg
*
- * https://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
+ * https://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
*
- * with appropriate updates.
+ * with appropriate updates.
*
*
- * Segments
+ * Segments
*
- * `af_{cjk,latin,...}_hints_compute_segments' are the functions to
- * find segments in an outline.
+ * `af_{cjk,latin,...}_hints_compute_segments' are the functions to
+ * find segments in an outline.
*
- * A segment is a series of at least two consecutive points that are
- * approximately aligned along a coordinate axis. The analysis to do
- * so is specific to a writing system.
+ * A segment is a series of at least two consecutive points that are
+ * approximately aligned along a coordinate axis. The analysis to do
+ * so is specific to a writing system.
*
*
- * Edges
+ * Edges
*
- * `af_{cjk,latin,...}_hints_compute_edges' are the functions to find
- * edges.
+ * `af_{cjk,latin,...}_hints_compute_edges' are the functions to find
+ * edges.
*
- * As soon as segments are defined, the auto-hinter groups them into
- * edges. An edge corresponds to a single position on the main
- * dimension that collects one or more segments (allowing for a small
- * threshold).
+ * As soon as segments are defined, the auto-hinter groups them into
+ * edges. An edge corresponds to a single position on the main
+ * dimension that collects one or more segments (allowing for a small
+ * threshold).
*
- * As an example, the `latin' writing system first tries to grid-fit
- * edges, then to align segments on the edges unless it detects that
- * they form a serif.
+ * As an example, the `latin' writing system first tries to grid-fit
+ * edges, then to align segments on the edges unless it detects that
+ * they form a serif.
*
*
- * A H
- * | |
- * | |
- * | |
- * | |
- * C | | F
- * +------<-----+ +-----<------+
- * | B G |
- * | |
- * | |
- * +--------------->------------------+
- * D E
+ * A H
+ * | |
+ * | |
+ * | |
+ * | |
+ * C | | F
+ * +------<-----+ +-----<------+
+ * | B G |
+ * | |
+ * | |
+ * +--------------->------------------+
+ * D E
*
*
- * Stems
+ * Stems
*
- * Stems are detected by `af_{cjk,latin,...}_hint_edges'.
+ * Stems are detected by `af_{cjk,latin,...}_hint_edges'.
*
- * Segments need to be `linked' to other ones in order to detect stems.
- * A stem is made of two segments that face each other in opposite
- * directions and that are sufficiently close to each other. Using
- * vocabulary from the TrueType specification, stem segments form a
- * `black distance'.
+ * Segments need to be `linked' to other ones in order to detect stems.
+ * A stem is made of two segments that face each other in opposite
+ * directions and that are sufficiently close to each other. Using
+ * vocabulary from the TrueType specification, stem segments form a
+ * `black distance'.
*
- * In the above ASCII drawing, the horizontal segments are BC, DE, and
- * FG; the vertical segments are AB, CD, EF, and GH.
+ * In the above ASCII drawing, the horizontal segments are BC, DE, and
+ * FG; the vertical segments are AB, CD, EF, and GH.
*
- * Each segment has at most one `best' candidate to form a black
- * distance, or no candidate at all. Notice that two distinct segments
- * can have the same candidate, which frequently means a serif.
+ * Each segment has at most one `best' candidate to form a black
+ * distance, or no candidate at all. Notice that two distinct segments
+ * can have the same candidate, which frequently means a serif.
*
- * A stem is recognized by the following condition:
+ * A stem is recognized by the following condition:
*
- * best segment_1 = segment_2 && best segment_2 = segment_1
+ * best segment_1 = segment_2 && best segment_2 = segment_1
*
- * The best candidate is stored in field `link' in structure
- * `AF_Segment'.
+ * The best candidate is stored in field `link' in structure
+ * `AF_Segment'.
*
- * In the above ASCII drawing, the best candidate for both AB and CD is
- * GH, while the best candidate for GH is AB. Similarly, the best
- * candidate for EF and GH is AB, while the best candidate for AB is
- * GH.
+ * In the above ASCII drawing, the best candidate for both AB and CD is
+ * GH, while the best candidate for GH is AB. Similarly, the best
+ * candidate for EF and GH is AB, while the best candidate for AB is
+ * GH.
*
- * The detection and handling of stems is dependent on the writing
- * system.
+ * The detection and handling of stems is dependent on the writing
+ * system.
*
*
- * Serifs
+ * Serifs
*
- * Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
+ * Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
*
- * In comparison to a stem, a serif (as handled by the auto-hinter
- * module that takes care of the `latin' writing system) has
+ * In comparison to a stem, a serif (as handled by the auto-hinter
+ * module that takes care of the `latin' writing system) has
*
- * best segment_1 = segment_2 && best segment_2 != segment_1
+ * best segment_1 = segment_2 && best segment_2 != segment_1
*
- * where segment_1 corresponds to the serif segment (CD and EF in the
- * above ASCII drawing).
+ * where segment_1 corresponds to the serif segment (CD and EF in the
+ * above ASCII drawing).
*
- * The best candidate is stored in field `serif' in structure
- * `AF_Segment' (and `link' is set to NULL).
+ * The best candidate is stored in field `serif' in structure
+ * `AF_Segment' (and `link' is set to NULL).
*
*
- * Touched points
+ * Touched points
*
- * A point is called `touched' if it has been processed somehow by the
- * auto-hinter. It basically means that it shouldn't be moved again
- * (or moved only under certain constraints to preserve the already
- * applied processing).
+ * A point is called `touched' if it has been processed somehow by the
+ * auto-hinter. It basically means that it shouldn't be moved again
+ * (or moved only under certain constraints to preserve the already
+ * applied processing).
*
*
- * Flat and round segments
+ * Flat and round segments
*
- * Segments are `round' or `flat', depending on the series of points
- * that define them. A segment is round if the next and previous point
- * of an extremum (which can be either a single point or sequence of
- * points) are both conic or cubic control points. Otherwise, a
- * segment with an extremum is flat.
+ * Segments are `round' or `flat', depending on the series of points
+ * that define them. A segment is round if the next and previous point
+ * of an extremum (which can be either a single point or sequence of
+ * points) are both conic or cubic control points. Otherwise, a
+ * segment with an extremum is flat.
*
*
- * Strong Points
+ * Strong Points
*
- * Experience has shown that points not part of an edge need to be
- * interpolated linearly between their two closest edges, even if these
- * are not part of the contour of those particular points. Typical
- * candidates for this are
+ * Experience has shown that points not part of an edge need to be
+ * interpolated linearly between their two closest edges, even if these
+ * are not part of the contour of those particular points. Typical
+ * candidates for this are
*
- * - angle points (i.e., points where the `in' and `out' direction
- * differ greatly)
+ * - angle points (i.e., points where the `in' and `out' direction
+ * differ greatly)
*
- * - inflection points (i.e., where the `in' and `out' angles are the
- * same, but the curvature changes sign) [currently, such points
- * aren't handled specially in the auto-hinter]
+ * - inflection points (i.e., where the `in' and `out' angles are the
+ * same, but the curvature changes sign) [currently, such points
+ * aren't handled specially in the auto-hinter]
*
- * `af_glyph_hints_align_strong_points' is the function that takes
- * care of such situations; it is equivalent to the TrueType `IP'
- * hinting instruction.
+ * `af_glyph_hints_align_strong_points' is the function that takes
+ * care of such situations; it is equivalent to the TrueType `IP'
+ * hinting instruction.
*
*
- * Weak Points
+ * Weak Points
*
- * Other points in the outline must be interpolated using the
- * coordinates of their previous and next unfitted contour neighbours.
- * These are called `weak points' and are touched by the function
- * `af_glyph_hints_align_weak_points', equivalent to the TrueType `IUP'
- * hinting instruction. Typical candidates are control points and
- * points on the contour without a major direction.
+ * Other points in the outline must be interpolated using the
+ * coordinates of their previous and next unfitted contour neighbours.
+ * These are called `weak points' and are touched by the function
+ * `af_glyph_hints_align_weak_points', equivalent to the TrueType `IUP'
+ * hinting instruction. Typical candidates are control points and
+ * points on the contour without a major direction.
*
- * The major effect is to reduce possible distortion caused by
- * alignment of edges and strong points, thus weak points are processed
- * after strong points.
+ * The major effect is to reduce possible distortion caused by
+ * alignment of edges and strong points, thus weak points are processed
+ * after strong points.
*/
@@ -252,6 +252,12 @@ FT_BEGIN_HEADER
AF_Point next; /* next point in contour */
AF_Point prev; /* previous point in contour */
+#ifdef FT_DEBUG_AUTOFIT
+ /* track `before' and `after' edges for strong points */
+ AF_Edge before[2];
+ AF_Edge after[2];
+#endif
+
} AF_PointRec;
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c
index dfbea5f34c1..a17117c7129 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afindic.c */
-/* */
-/* Auto-fitter hinting routines for Indic writing system (body). */
-/* */
-/* Copyright 2007-2018 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, */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afindic.c
+ *
+ * Auto-fitter hinting routines for Indic writing system (body).
+ *
+ * Copyright (C) 2007-2019 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,
+ * 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"
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h
index 5688738e6e0..bc5bc59fa55 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* afindic.h */
-/* */
-/* Auto-fitter hinting routines for Indic writing system */
-/* (specification). */
-/* */
-/* Copyright 2007-2018 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, */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afindic.h
+ *
+ * Auto-fitter hinting routines for Indic writing system
+ * (specification).
+ *
+ * Copyright (C) 2007-2019 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,
+ * 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 AFINDIC_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c
index 9f1b54056f1..dccdcaf3457 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* aflatin.c */
-/* */
-/* Auto-fitter hinting routines for latin writing system (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * aflatin.c
+ *
+ * Auto-fitter hinting routines for latin writing system (body).
+ *
+ * Copyright (C) 2003-2019 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 <ft2build.h>
@@ -21,7 +21,6 @@
#include FT_INTERNAL_DEBUG_H
#include "afglobal.h"
-#include "afpic.h"
#include "aflatin.h"
#include "aferrors.h"
@@ -31,14 +30,14 @@
#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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_aflatin
+#define FT_COMPONENT aflatin
/* needed for computation of round vs. flat segments */
@@ -83,24 +82,30 @@
AF_LatinMetricsRec dummy[1];
AF_Scaler scaler = &dummy->root.scaler;
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = metrics->root.globals;
-#endif
-
AF_StyleClass style_class = metrics->root.style_class;
- AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
- [style_class->script];
+ AF_ScriptClass script_class = af_script_classes[style_class->script];
+
+ /* If HarfBuzz is not available, we need a pointer to a single */
+ /* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
+ FT_ULong shaper_buf_;
+ void* shaper_buf = &shaper_buf_;
+#endif
- void* shaper_buf;
const char* p;
#ifdef FT_DEBUG_LEVEL_TRACE
FT_ULong ch = 0;
#endif
- p = script_class->standard_charstring;
- shaper_buf = af_shaper_buf_create( face );
+ p = script_class->standard_charstring;
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
/*
* We check a list of standard characters to catch features like
* `c2sc' (small caps from caps) that don't contain lowercase letters
@@ -186,10 +191,10 @@
goto Exit;
/*
- * We assume that the glyphs selected for the stem width
- * computation are `featureless' enough so that the linking
- * algorithm works fine without adjustments of its scoring
- * function.
+ * We assume that the glyphs selected for the stem width
+ * computation are `featureless' enough so that the linking
+ * algorithm works fine without adjustments of its scoring
+ * function.
*/
af_latin_hints_link_segments( hints,
0,
@@ -329,7 +334,14 @@
FT_Pos flat_threshold = FLAT_THRESHOLD( metrics->units_per_em );
- void* shaper_buf;
+ /* If HarfBuzz is not available, we need a pointer to a single */
+ /* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
+ FT_ULong shaper_buf_;
+ void* shaper_buf = &shaper_buf_;
+#endif
/* we walk over the blue character strings as specified in the */
@@ -339,7 +351,9 @@
"============================\n"
"\n" ));
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
shaper_buf = af_shaper_buf_create( face );
+#endif
for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
{
@@ -884,8 +898,8 @@
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
+ * we couldn't find a single glyph to compute this blue zone,
+ * we will simply ignore it then
*/
FT_TRACE5(( " empty\n" ));
continue;
@@ -1036,15 +1050,25 @@
FT_Bool started = 0, same_width = 1;
FT_Fixed advance = 0, old_advance = 0;
- void* shaper_buf;
+ /* If HarfBuzz is not available, we need a pointer to a single */
+ /* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
+ FT_ULong shaper_buf_;
+ void* shaper_buf = &shaper_buf_;
+#endif
/* in all supported charmaps, digits have character codes 0x30-0x39 */
const char digits[] = "0 1 2 3 4 5 6 7 8 9";
const char* p;
- p = digits;
+ p = digits;
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
shaper_buf = af_shaper_buf_create( face );
+#endif
while ( *p )
{
@@ -1283,7 +1307,7 @@
/* 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 );
+ FT_BOOL( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
#ifdef FT_DEBUG_LEVEL_TRACE
if ( axis->extra_light )
@@ -1967,17 +1991,17 @@
if ( len >= len_threshold )
{
/*
- * The score is the sum of two demerits indicating the
- * `badness' of a fit, measured along the segments' main axis
- * and orthogonal to it, respectively.
+ * The score is the sum of two demerits indicating the
+ * `badness' of a fit, measured along the segments' main axis
+ * and orthogonal to it, respectively.
*
- * o The less overlapping along the main axis, the worse it
- * is, causing a larger demerit.
+ * - The less overlapping along the main axis, the worse it
+ * is, causing a larger demerit.
*
- * o The nearer the orthogonal distance to a stem width, the
- * better it is, causing a smaller demerit. For simplicity,
- * however, we only increase the demerit for values that
- * exceed the largest stem width.
+ * - The nearer the orthogonal distance to a stem width, the
+ * better it is, causing a smaller demerit. For simplicity,
+ * however, we only increase the demerit for values that
+ * exceed the largest stem width.
*/
FT_Pos dist = pos2 - pos1;
@@ -2049,13 +2073,8 @@
FT_Memory memory = hints->memory;
AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = hints->metrics->globals;
-#endif
-
AF_StyleClass style_class = hints->metrics->style_class;
- AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
- [style_class->script];
+ AF_ScriptClass script_class = af_script_classes[style_class->script];
FT_Bool top_to_bottom_hinting = 0;
@@ -2086,9 +2105,9 @@
top_to_bottom_hinting = script_class->top_to_bottom_hinting;
/*
- * We ignore all segments that are less than 1 pixel in length
- * to avoid many problems with serif fonts. We compute the
- * corresponding threshold in font units.
+ * We ignore all segments that are less than 1 pixel in length
+ * to avoid many problems with serif fonts. We compute the
+ * corresponding threshold in font units.
*/
if ( dim == AF_DIMENSION_HORZ )
segment_length_threshold = FT_DivFix( 64, hints->y_scale );
@@ -2096,26 +2115,26 @@
segment_length_threshold = 0;
/*
- * Similarly, we ignore segments that have a width delta
- * larger than 0.5px (i.e., a width larger than 1px).
+ * Similarly, we ignore segments that have a width delta
+ * larger than 0.5px (i.e., a width larger than 1px).
*/
segment_width_threshold = FT_DivFix( 32, scale );
- /*********************************************************************/
- /* */
- /* We 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 gets processed in the second step to compute the */
- /* edge's properties. */
- /* */
- /* Note that the table of edges is sorted along the segment/edge */
- /* position. */
- /* */
- /*********************************************************************/
+ /**********************************************************************
+ *
+ * We 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 gets processed in the second step to compute the
+ * edge's properties.
+ *
+ * Note that the table of edges is sorted along the segment/edge
+ * position.
+ *
+ */
/* assure that edge distance threshold is at most 0.25px */
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
@@ -2237,17 +2256,17 @@
}
- /******************************************************************/
- /* */
- /* Good, we now compute each edge's properties according to the */
- /* segments found on its position. Basically, these are */
- /* */
- /* - the 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 */
- /* */
- /******************************************************************/
+ /*******************************************************************
+ *
+ * Good, we now compute each edge's properties according to the
+ * segments found on its position. Basically, these are
+ *
+ * - the 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 */
@@ -2309,9 +2328,9 @@
/* 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 );
+ is_serif = FT_BOOL( seg->serif &&
+ seg->serif->edge &&
+ seg->serif->edge != edge );
if ( ( seg->link && seg->link->edge ) || is_serif )
{
@@ -2546,8 +2565,8 @@
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
/*
- * correct x_scale and y_scale if needed, since they may have
- * been modified by `af_latin_metrics_scale_dim' above
+ * correct x_scale and y_scale if needed, since they may have
+ * been modified by `af_latin_metrics_scale_dim' above
*/
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
@@ -2566,21 +2585,21 @@
other_flags = 0;
/*
- * We snap the width of vertical stems for the monochrome and
- * horizontal LCD rendering targets only.
+ * 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.
+ * 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.
+ * 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;
@@ -2589,11 +2608,11 @@
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.
+ * In `light' or `lcd' mode we disable horizontal hinting completely.
+ * We also do it if the face is italic.
*
- * However, if warping is enabled (which only works in `light' hinting
- * mode), advance widths get adjusted, too.
+ * However, if warping is enabled (which only works in `light' hinting
+ * mode), advance widths get adjusted, too.
*/
if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
@@ -2936,13 +2955,8 @@
AF_Edge anchor = NULL;
FT_Int has_serifs = 0;
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = hints->metrics->globals;
-#endif
-
AF_StyleClass style_class = hints->metrics->style_class;
- AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
- [style_class->script];
+ AF_ScriptClass script_class = af_script_classes[style_class->script];
FT_Bool top_to_bottom_hinting = 0;
@@ -2976,12 +2990,12 @@
edge2 = edge->link;
/*
- * If a stem contains both a neutral and a non-neutral blue zone,
- * skip the neutral one. Otherwise, outlines with different
- * directions might be incorrectly aligned at the same vertical
- * position.
+ * If a stem contains both a neutral and a non-neutral blue zone,
+ * skip the neutral one. Otherwise, outlines with different
+ * directions might be incorrectly aligned at the same vertical
+ * position.
*
- * If we have two neutral blue zones, skip one of them.
+ * If we have two neutral blue zones, skip one of them.
*
*/
if ( edge->blue_edge && edge2 && edge2->blue_edge )
@@ -3344,8 +3358,8 @@
if ( has_serifs || !anchor )
{
/*
- * now hint the remaining edges (serifs and single) in order
- * to complete our processing
+ * now hint the remaining edges (serifs and single) in order
+ * to complete our processing
*/
for ( edge = edges; edge < edge_limit; edge++ )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h
index 432cccce4e2..40479538c25 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* aflatin.h */
-/* */
-/* Auto-fitter hinting routines for latin writing system */
-/* (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * aflatin.h
+ *
+ * Auto-fitter hinting routines for latin writing system
+ * (specification).
+ *
+ * Copyright (C) 2003-2019 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 AFLATIN_H_
@@ -45,9 +45,9 @@ FT_BEGIN_HEADER
/*
- * The following declarations could be embedded in the file `aflatin.c';
- * they have been made semi-public to allow alternate writing system
- * hinters to re-use some of them.
+ * The following declarations could be embedded in the file `aflatin.c';
+ * they have been made semi-public to allow alternate writing system
+ * hinters to re-use some of them.
*/
@@ -161,8 +161,8 @@ FT_BEGIN_HEADER
/*
- * The next functions shouldn't normally be exported. However, other
- * writing systems might like to use these functions as-is.
+ * The next functions shouldn't normally be exported. However, other
+ * writing systems might like to use these functions as-is.
*/
FT_LOCAL( FT_Error )
af_latin_hints_compute_segments( AF_GlyphHints hints,
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c
index 5c713781189..c601ab8d9ac 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c
@@ -3,22 +3,22 @@
/* marked as experimental. */
-/***************************************************************************/
-/* */
-/* aflatin2.c */
-/* */
-/* Auto-fitter hinting routines for latin writing system (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * aflatin2.c
+ *
+ * Auto-fitter hinting routines for latin writing system (body).
+ *
+ * Copyright (C) 2003-2019 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 FT_ADVANCES_H
@@ -37,14 +37,14 @@
#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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_aflatin2
+#define FT_COMPONENT aflatin2
FT_LOCAL_DEF( FT_Error )
@@ -265,7 +265,7 @@
/* 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 )
+ if ( last <= first )
continue;
if ( AF_LATIN_IS_TOP_BLUE( bb ) )
@@ -299,6 +299,7 @@
/* 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;
@@ -358,8 +359,8 @@
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
+ * we couldn't find a single glyph to compute this blue zone,
+ * we will simply ignore it then
*/
FT_TRACE5(( " empty\n" ));
continue;
@@ -632,7 +633,7 @@
/* 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 );
+ FT_BOOL( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
if ( dim == AF_DIMENSION_VERT )
{
@@ -1108,13 +1109,13 @@
: 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
+ * 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
+ * also, unlink serif segments that are linked to segments farther
+ * than 50% of the standard width
*/
if ( dim == AF_DIMENSION_HORZ )
{
@@ -1126,21 +1127,21 @@
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. */
- /* */
- /*********************************************************************/
+ /**********************************************************************
+ *
+ * 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 );
@@ -1230,17 +1231,17 @@
}
- /*********************************************************************/
- /* */
- /* 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 */
- /* */
- /*********************************************************************/
+ /**********************************************************************
+ *
+ * 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 */
@@ -1302,9 +1303,9 @@
/* 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 );
+ is_serif = FT_BOOL( seg->serif &&
+ seg->serif->edge &&
+ seg->serif->edge != edge );
if ( ( seg->link && seg->link->edge ) || is_serif )
{
@@ -1524,8 +1525,8 @@
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
+ * 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;
@@ -1544,21 +1545,21 @@
other_flags = 0;
/*
- * We snap the width of vertical stems for the monochrome and
- * horizontal LCD rendering targets only.
+ * 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.
+ * 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.
+ * 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;
@@ -1567,8 +1568,8 @@
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.
+ * 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 )
@@ -2233,8 +2234,8 @@
if ( has_serifs || !anchor )
{
/*
- * now hint the remaining edges (serifs and single) in order
- * to complete our processing
+ * now hint the remaining edges (serifs and single) in order
+ * to complete our processing
*/
for ( edge = edges; edge < edge_limit; edge++ )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h
index 0129dc707e6..507cef3df2b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h
@@ -3,23 +3,23 @@
/* marked as experimental. */
-/***************************************************************************/
-/* */
-/* aflatin2.h */
-/* */
-/* Auto-fitter hinting routines for latin writing system */
-/* (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * aflatin2.h
+ *
+ * Auto-fitter hinting routines for latin writing system
+ * (specification).
+ *
+ * Copyright (C) 2003-2019 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_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c
index a55550b3385..83743b7be15 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afloader.c */
-/* */
-/* Auto-fitter glyph loading routines (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afloader.c
+ *
+ * Auto-fitter glyph loading routines (body).
+ *
+ * Copyright (C) 2003-2019 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 "afglobal.h"
@@ -21,7 +21,6 @@
#include "afhints.h"
#include "aferrors.h"
#include "afmodule.h"
-#include "afpic.h"
#include FT_INTERNAL_CALC_H
@@ -119,12 +118,12 @@
}
/*
- * We depend on the writing system (script analyzers) to supply
- * standard widths for the script of the glyph we are looking at. If
- * it can't deliver, stem darkening is disabled.
+ * We depend on the writing system (script analyzers) to supply
+ * standard widths for the script of the glyph we are looking at. If
+ * it can't deliver, stem darkening is disabled.
*/
writing_system_class =
- AF_WRITING_SYSTEM_CLASSES_GET[style_metrics->style_class->writing_system];
+ af_writing_system_classes[style_metrics->style_class->writing_system];
if ( writing_system_class->style_metrics_getstdw )
writing_system_class->style_metrics_getstdw( style_metrics,
@@ -174,22 +173,22 @@
globals->darken_y = af_fixedToInt( darken_y );
/*
- * Scale outlines down on the Y-axis to keep them inside their blue
- * zones. The stronger the emboldening, the stronger the downscaling
- * (plus heuristical padding to prevent outlines still falling out
- * their zones due to rounding).
+ * Scale outlines down on the Y-axis to keep them inside their blue
+ * zones. The stronger the emboldening, the stronger the downscaling
+ * (plus heuristical padding to prevent outlines still falling out
+ * their zones due to rounding).
*
- * Reason: `FT_Outline_Embolden' works by shifting the rightmost
- * points of stems farther to the right, and topmost points farther
- * up. This positions points on the Y-axis outside their
- * pre-computed blue zones and leads to distortion when applying the
- * hints in the code further below. Code outside this emboldening
- * block doesn't know we are presenting it with modified outlines the
- * analyzer didn't see!
+ * Reason: `FT_Outline_Embolden' works by shifting the rightmost
+ * points of stems farther to the right, and topmost points farther
+ * up. This positions points on the Y-axis outside their
+ * pre-computed blue zones and leads to distortion when applying the
+ * hints in the code further below. Code outside this emboldening
+ * block doesn't know we are presenting it with modified outlines the
+ * analyzer didn't see!
*
- * An unfortunate side effect of downscaling is that the emboldening
- * effect is slightly decreased. The loss becomes more pronounced
- * versus the CFF driver at smaller sizes, e.g., at 9ppem and below.
+ * An unfortunate side effect of downscaling is that the emboldening
+ * effect is slightly decreased. The loss becomes more pronounced
+ * versus the CFF driver at smaller sizes, e.g., at 9ppem and below.
*/
globals->scale_down_factor =
FT_DivFix( em_size - ( darken_by_font_units_y + af_intToFixed( 8 ) ),
@@ -232,10 +231,6 @@
AF_StyleClass style_class;
AF_WritingSystemClass writing_system_class;
-#ifdef FT_CONFIG_OPTION_PIC
- AF_FaceGlobals globals = loader->globals;
-#endif
-
if ( !size )
return FT_THROW( Invalid_Size_Handle );
@@ -282,13 +277,13 @@
}
/*
- * TODO: This code currently doesn't support fractional advance widths,
- * i.e., placing hinted glyphs at anything other than integer
- * x-positions. This is only relevant for the warper code, which
- * scales and shifts glyphs to optimize blackness of stems (hinting on
- * the x-axis by nature places things on pixel integers, hinting on the
- * y-axis only, i.e., LIGHT mode, doesn't touch the x-axis). The delta
- * values of the scaler would need to be adjusted.
+ * TODO: This code currently doesn't support fractional advance widths,
+ * i.e., placing hinted glyphs at anything other than integer
+ * x-positions. This is only relevant for the warper code, which
+ * scales and shifts glyphs to optimize blackness of stems (hinting on
+ * the x-axis by nature places things on pixel integers, hinting on the
+ * y-axis only, i.e., LIGHT mode, doesn't touch the x-axis). The delta
+ * values of the scaler would need to be adjusted.
*/
scaler.face = face;
scaler.x_scale = size_internal->autohint_metrics.x_scale;
@@ -312,10 +307,10 @@
#endif
/*
- * Glyphs (really code points) are assigned to scripts. Script
- * analysis is done lazily: For each glyph that passes through here,
- * the corresponding script analyzer is called, but returns immediately
- * if it has been run already.
+ * Glyphs (really code points) are assigned to scripts. Script
+ * analysis is done lazily: For each glyph that passes through here,
+ * the corresponding script analyzer is called, but returns immediately
+ * if it has been run already.
*/
error = af_face_globals_get_metrics( loader->globals, glyph_index,
style_options, &style_metrics );
@@ -324,7 +319,7 @@
style_class = style_metrics->style_class;
writing_system_class =
- AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
+ af_writing_system_classes[style_class->writing_system];
loader->metrics = style_metrics;
@@ -342,11 +337,11 @@
}
/*
- * Do the main work of `af_loader_load_glyph'. Note that we never have
- * to deal with composite glyphs as those get loaded into
- * FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function.
- * In the rare cases where FT_LOAD_NO_RECURSE is set, it implies
- * FT_LOAD_NO_SCALE and as such the auto-hinter is never called.
+ * Do the main work of `af_loader_load_glyph'. Note that we never have
+ * to deal with composite glyphs as those get loaded into
+ * FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function.
+ * In the rare cases where FT_LOAD_NO_RECURSE is set, it implies
+ * FT_LOAD_NO_SCALE and as such the auto-hinter is never called.
*/
load_flags |= FT_LOAD_NO_SCALE |
FT_LOAD_IGNORE_TRANSFORM |
@@ -358,26 +353,26 @@
goto Exit;
/*
- * Apply stem darkening (emboldening) here before hints are applied to
- * the outline. Glyphs are scaled down proportionally to the
- * emboldening so that curve points don't fall outside their
- * precomputed blue zones.
+ * Apply stem darkening (emboldening) here before hints are applied to
+ * the outline. Glyphs are scaled down proportionally to the
+ * emboldening so that curve points don't fall outside their
+ * precomputed blue zones.
*
- * Any emboldening done by the font driver (e.g., the CFF driver)
- * doesn't reach here because the autohinter loads the unprocessed
- * glyphs in font units for analysis (functions `af_*_metrics_init_*')
- * and then above to prepare it for the rasterizers by itself,
- * independently of the font driver. So emboldening must be done here,
- * within the autohinter.
+ * Any emboldening done by the font driver (e.g., the CFF driver)
+ * doesn't reach here because the autohinter loads the unprocessed
+ * glyphs in font units for analysis (functions `af_*_metrics_init_*')
+ * and then above to prepare it for the rasterizers by itself,
+ * independently of the font driver. So emboldening must be done here,
+ * within the autohinter.
*
- * All glyphs to be autohinted pass through here one by one. The
- * standard widths can therefore change from one glyph to the next,
- * depending on what script a glyph is assigned to (each script has its
- * own set of standard widths and other metrics). The darkening amount
- * must therefore be recomputed for each size and
- * `standard_{vertical,horizontal}_width' change.
+ * All glyphs to be autohinted pass through here one by one. The
+ * standard widths can therefore change from one glyph to the next,
+ * depending on what script a glyph is assigned to (each script has its
+ * own set of standard widths and other metrics). The darkening amount
+ * must therefore be recomputed for each size and
+ * `standard_{vertical,horizontal}_width' change.
*
- * Ignore errors and carry on without emboldening.
+ * Ignore errors and carry on without emboldening.
*
*/
@@ -426,35 +421,39 @@
/* now load the slot image into the auto-outline */
/* and run the automatic hinting process */
if ( writing_system_class->style_hints_apply )
- writing_system_class->style_hints_apply( glyph_index,
- hints,
- &gloader->base.outline,
- style_metrics );
+ {
+ error = writing_system_class->style_hints_apply(
+ glyph_index,
+ hints,
+ &gloader->base.outline,
+ style_metrics );
+ if ( error )
+ goto Exit;
+ }
/* we now need to adjust the metrics according to the change in */
/* width/positioning that occurred during the hinting process */
if ( scaler.render_mode != FT_RENDER_MODE_LIGHT )
{
- FT_Pos old_rsb, old_lsb, new_lsb;
- FT_Pos pp1x_uh, pp2x_uh;
-
AF_AxisHints axis = &hints->axis[AF_DIMENSION_HORZ];
- AF_Edge edge1 = axis->edges; /* leftmost edge */
- AF_Edge edge2 = edge1 +
- axis->num_edges - 1; /* rightmost edge */
if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) )
{
- old_rsb = loader->pp2.x - edge2->opos;
+ AF_Edge edge1 = axis->edges; /* leftmost edge */
+ AF_Edge edge2 = edge1 +
+ axis->num_edges - 1; /* rightmost edge */
+
+ FT_Pos old_rsb = loader->pp2.x - edge2->opos;
/* loader->pp1.x is always zero at this point of time */
- old_lsb = edge1->opos /* - loader->pp1.x */;
- new_lsb = edge1->pos;
+ FT_Pos old_lsb = edge1->opos; /* - loader->pp1.x */
+ FT_Pos new_lsb = edge1->pos;
/* remember unhinted values to later account */
/* for rounding errors */
- pp1x_uh = new_lsb - old_lsb;
- pp2x_uh = edge2->pos + old_rsb;
+ FT_Pos pp1x_uh = new_lsb - old_lsb;
+ FT_Pos pp2x_uh = edge2->pos + old_rsb;
+
/* prefer too much space over too little space */
/* for very small sizes */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h
index d4d72d15830..d1e0f3c093d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afloader.h */
-/* */
-/* Auto-fitter glyph loading routines (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afloader.h
+ *
+ * Auto-fitter glyph loading routines (specification).
+ *
+ * Copyright (C) 2003-2019 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 AFLOADER_H_
@@ -27,11 +27,11 @@
FT_BEGIN_HEADER
/*
- * The autofitter module's (global) data structure to communicate with
- * actual fonts. If necessary, `local' data like the current face, the
- * current face's auto-hint data, or the current glyph's parameters
- * relevant to auto-hinting are `swapped in'. Cf. functions like
- * `af_loader_reset' and `af_loader_load_g'.
+ * The autofitter module's (global) data structure to communicate with
+ * actual fonts. If necessary, `local' data like the current face, the
+ * current face's auto-hint data, or the current glyph's parameters
+ * relevant to auto-hinting are `swapped in'. Cf. functions like
+ * `af_loader_reset' and `af_loader_load_g'.
*/
typedef struct AF_LoaderRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c
index dcaa17a27e9..3e46a3655a4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c
@@ -1,26 +1,25 @@
-/***************************************************************************/
-/* */
-/* afmodule.c */
-/* */
-/* Auto-fitter module implementation (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afmodule.c
+ *
+ * Auto-fitter module implementation (body).
+ *
+ * Copyright (C) 2003-2019 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 "afglobal.h"
#include "afmodule.h"
#include "afloader.h"
#include "aferrors.h"
-#include "afpic.h"
#ifdef FT_DEBUG_AUTOFIT
@@ -60,14 +59,14 @@
#include FT_SERVICE_PROPERTIES_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_afmodule
+#define FT_COMPONENT afmodule
static FT_Error
@@ -104,19 +103,6 @@
}
-#ifdef FT_CONFIG_OPTION_PIC
-
-#undef AF_SCRIPT_CLASSES_GET
-#define AF_SCRIPT_CLASSES_GET \
- ( GET_PIC( ft_module->library )->af_script_classes )
-
-#undef AF_STYLE_CLASSES_GET
-#define AF_STYLE_CLASSES_GET \
- ( GET_PIC( ft_module->library )->af_style_classes )
-
-#endif
-
-
static FT_Error
af_property_set( FT_Module ft_module,
const char* property_name,
@@ -147,9 +133,9 @@
/* We translate the fallback script to a fallback style that uses */
/* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */
/* coverage value. */
- for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+ for ( ss = 0; af_style_classes[ss]; ss++ )
{
- AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
+ AF_StyleClass style_class = af_style_classes[ss];
if ( (FT_UInt)style_class->script == *fallback_script &&
@@ -160,7 +146,7 @@
}
}
- if ( !AF_STYLE_CLASSES_GET[ss] )
+ if ( !af_style_classes[ss] )
{
FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n",
fallback_script, property_name ));
@@ -357,7 +343,7 @@
{
FT_UInt* val = (FT_UInt*)value;
- AF_StyleClass style_class = AF_STYLE_CLASSES_GET[fallback_style];
+ AF_StyleClass style_class = af_style_classes[fallback_style];
*val = style_class->script;
@@ -440,28 +426,16 @@
FT_DEFINE_SERVICEDESCREC1(
af_services,
- FT_SERVICE_ID_PROPERTIES, &AF_SERVICE_PROPERTIES_GET )
+ FT_SERVICE_ID_PROPERTIES, &af_service_properties )
FT_CALLBACK_DEF( FT_Module_Interface )
af_get_interface( FT_Module module,
const char* module_interface )
{
- /* AF_SERVICES_GET dereferences `library' in PIC mode */
-#ifdef FT_CONFIG_OPTION_PIC
- FT_Library library;
-
-
- if ( !module )
- return NULL;
- library = module->library;
- if ( !library )
- return NULL;
-#else
FT_UNUSED( module );
-#endif
- return ft_service_list_lookup( AF_SERVICES_GET, module_interface );
+ return ft_service_list_lookup( af_services, module_interface );
}
@@ -533,7 +507,7 @@
glyph_index, load_flags );
#ifdef FT_DEBUG_LEVEL_TRACE
- if ( ft_trace_levels[FT_COMPONENT] )
+ if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] )
{
#endif
af_glyph_hints_dump_points( hints, 0 );
@@ -589,7 +563,7 @@
0x10000L, /* version 1.0 of the autofitter */
0x20000L, /* requires FreeType 2.0 or above */
- (const void*)&AF_INTERFACE_GET,
+ (const void*)&af_autofitter_interface,
(FT_Module_Constructor)af_autofitter_init, /* module_init */
(FT_Module_Destructor) af_autofitter_done, /* module_done */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h
index 56f64eaf231..b410809aa83 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afmodule.h */
-/* */
-/* Auto-fitter module implementation (specification). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afmodule.h
+ *
+ * Auto-fitter module implementation (specification).
+ *
+ * Copyright (C) 2003-2019 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 AFMODULE_H_
@@ -28,8 +28,8 @@ FT_BEGIN_HEADER
/*
- * This is the `extended' FT_Module structure that holds the
- * autofitter's global data.
+ * This is the `extended' FT_Module structure that holds the
+ * autofitter's global data.
*/
typedef struct AF_ModuleRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c
deleted file mode 100644
index d48d016a0e8..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************/
-/* */
-/* afpic.c */
-/* */
-/* The FreeType position independent code services for autofit module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "afpic.h"
-#include "afglobal.h"
-#include "aferrors.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from afmodule.c */
- FT_Error
- FT_Create_Class_af_services( FT_Library library,
- FT_ServiceDescRec** output_class );
-
- void
- FT_Destroy_Class_af_services( FT_Library library,
- FT_ServiceDescRec* clazz );
-
- void
- FT_Init_Class_af_service_properties( FT_Service_PropertiesRec* clazz );
-
- void FT_Init_Class_af_autofitter_interface(
- FT_Library library,
- FT_AutoHinter_InterfaceRec* clazz );
-
-
- /* forward declaration of PIC init functions from writing system classes */
-#undef WRITING_SYSTEM
-#define WRITING_SYSTEM( ws, WS ) /* empty */
-
-#include "afwrtsys.h"
-
-
- void
- autofit_module_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->autofit )
- {
- AFModulePIC* container = (AFModulePIC*)pic_container->autofit;
-
-
- if ( container->af_services )
- FT_Destroy_Class_af_services( library,
- container->af_services );
- container->af_services = NULL;
-
- FT_FREE( container );
- pic_container->autofit = NULL;
- }
- }
-
-
- FT_Error
- autofit_module_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_UInt ss;
- FT_Error error = FT_Err_Ok;
- AFModulePIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC ( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->autofit = container;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- error = FT_Create_Class_af_services( library,
- &container->af_services );
- if ( error )
- goto Exit;
-
- FT_Init_Class_af_service_properties( &container->af_service_properties );
-
- for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ )
- container->af_writing_system_classes[ss] =
- &container->af_writing_system_classes_rec[ss];
- container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;
-
- for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ )
- container->af_script_classes[ss] =
- &container->af_script_classes_rec[ss];
- container->af_script_classes[AF_SCRIPT_MAX] = NULL;
-
- for ( ss = 0; ss < AF_STYLE_MAX; ss++ )
- container->af_style_classes[ss] =
- &container->af_style_classes_rec[ss];
- container->af_style_classes[AF_STYLE_MAX] = NULL;
-
-#undef WRITING_SYSTEM
-#define WRITING_SYSTEM( ws, WS ) \
- FT_Init_Class_af_ ## ws ## _writing_system_class( \
- &container->af_writing_system_classes_rec[ss++] );
-
- ss = 0;
-#include "afwrtsys.h"
-
-#undef SCRIPT
-#define SCRIPT( s, S, d, h, H, sss ) \
- FT_Init_Class_af_ ## s ## _script_class( \
- &container->af_script_classes_rec[ss++] );
-
- ss = 0;
-#include "afscript.h"
-
-#undef STYLE
-#define STYLE( s, S, d, ws, sc, bss, c ) \
- FT_Init_Class_af_ ## s ## _style_class( \
- &container->af_style_classes_rec[ss++] );
-
- ss = 0;
-#include "afstyles.h"
-
- FT_Init_Class_af_autofitter_interface(
- library, &container->af_autofitter_interface );
-
- Exit:
- if ( error )
- autofit_module_class_pic_free( library );
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h
deleted file mode 100644
index 0c734567859..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************/
-/* */
-/* afpic.h */
-/* */
-/* The FreeType position independent code services for autofit module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 AFPIC_H_
-#define AFPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define AF_SERVICES_GET af_services
-#define AF_SERVICE_PROPERTIES_GET af_service_properties
-
-#define AF_WRITING_SYSTEM_CLASSES_GET af_writing_system_classes
-#define AF_SCRIPT_CLASSES_GET af_script_classes
-#define AF_STYLE_CLASSES_GET af_style_classes
-#define AF_INTERFACE_GET af_autofitter_interface
-
-#else /* FT_CONFIG_OPTION_PIC */
-
- /* some include files required for members of AFModulePIC */
-#include FT_SERVICE_PROPERTIES_H
-
-#include "aftypes.h"
-
-
-FT_BEGIN_HEADER
-
- typedef struct AFModulePIC_
- {
- FT_ServiceDescRec* af_services;
- FT_Service_PropertiesRec af_service_properties;
-
- AF_WritingSystemClass af_writing_system_classes
- [AF_WRITING_SYSTEM_MAX + 1];
- AF_WritingSystemClassRec af_writing_system_classes_rec
- [AF_WRITING_SYSTEM_MAX];
-
- AF_ScriptClass af_script_classes
- [AF_SCRIPT_MAX + 1];
- AF_ScriptClassRec af_script_classes_rec
- [AF_SCRIPT_MAX];
-
- AF_StyleClass af_style_classes
- [AF_STYLE_MAX + 1];
- AF_StyleClassRec af_style_classes_rec
- [AF_STYLE_MAX];
-
- FT_AutoHinter_InterfaceRec af_autofitter_interface;
-
- } AFModulePIC;
-
-
-#define GET_PIC( lib ) \
- ( (AFModulePIC*)( (lib)->pic_container.autofit ) )
-
-#define AF_SERVICES_GET \
- ( GET_PIC( library )->af_services )
-#define AF_SERVICE_PROPERTIES_GET \
- ( GET_PIC( library )->af_service_properties )
-
-#define AF_WRITING_SYSTEM_CLASSES_GET \
- ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes )
-#define AF_SCRIPT_CLASSES_GET \
- ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
-#define AF_STYLE_CLASSES_GET \
- ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_style_classes )
-#define AF_INTERFACE_GET \
- ( GET_PIC( library )->af_autofitter_interface )
-
-
- /* see afpic.c for the implementation */
- void
- autofit_module_class_pic_free( FT_Library library );
-
- FT_Error
- autofit_module_class_pic_init( FT_Library library );
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* AFPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c
index cf67fafb11c..c0dba818a13 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afranges.c */
-/* */
-/* Auto-fitter Unicode script ranges (body). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afranges.c
+ *
+ * Auto-fitter Unicode script ranges (body).
+ *
+ * Copyright (C) 2013-2019 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 "afranges.h"
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h
index ba3b5e7ccbc..d5917aefed0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afranges.h */
-/* */
-/* Auto-fitter Unicode script ranges (specification). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afranges.h
+ *
+ * Auto-fitter Unicode script ranges (specification).
+ *
+ * Copyright (C) 2013-2019 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 AFRANGES_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h
index 623a1734a62..c2f0c7ac60a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afscript.h */
-/* */
-/* Auto-fitter scripts (specification only). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afscript.h
+ *
+ * Auto-fitter scripts (specification only).
+ *
+ * Copyright (C) 2013-2019 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 following part can be included multiple times. */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c
index f30828173cf..a5191c69158 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afshaper.c */
-/* */
-/* HarfBuzz interface for accessing OpenType features (body). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afshaper.c
+ *
+ * HarfBuzz interface for accessing OpenType features (body).
+ *
+ * Copyright (C) 2013-2019 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 <ft2build.h>
@@ -26,14 +26,14 @@
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_afshaper
+#define FT_COMPONENT afshaper
/*
@@ -591,14 +591,9 @@
void*
af_shaper_buf_create( FT_Face face )
{
- FT_Error error;
- FT_Memory memory = face->memory;
- FT_ULong* buf;
-
-
- FT_MEM_ALLOC( buf, sizeof ( FT_ULong ) );
+ FT_UNUSED( face );
- return (void*)buf;
+ return NULL;
}
@@ -606,10 +601,8 @@
af_shaper_buf_destroy( FT_Face face,
void* buf )
{
- FT_Memory memory = face->memory;
-
-
- FT_FREE( buf );
+ FT_UNUSED( face );
+ FT_UNUSED( buf );
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h
index 7efd9f6a4e6..06a1e066162 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afshaper.h */
-/* */
-/* HarfBuzz interface for accessing OpenType features (specification). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afshaper.h
+ *
+ * HarfBuzz interface for accessing OpenType features (specification).
+ *
+ * Copyright (C) 2013-2019 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 AFSHAPER_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h
index e2688b3fc25..edf4f54edd7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afstyles.h */
-/* */
-/* Auto-fitter styles (specification only). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afstyles.h
+ *
+ * Auto-fitter styles (specification only).
+ *
+ * Copyright (C) 2013-2019 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 following part can be included multiple times. */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h
index 6bd8c895b2a..579003d27d9 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h
@@ -1,30 +1,30 @@
-/***************************************************************************/
-/* */
-/* aftypes.h */
-/* */
-/* Auto-fitter types (specification only). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * aftypes.h
+ *
+ * Auto-fitter types (specification only).
+ *
+ * Copyright (C) 2003-2019 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 auto-fitter is a complete rewrite of the old auto-hinter.
- * Its main feature is the ability to differentiate between different
- * writing systems and scripts in order to apply specific rules.
+ * The auto-fitter is a complete rewrite of the old auto-hinter.
+ * Its main feature is the ability to differentiate between different
+ * writing systems and scripts in order to apply specific rules.
*
- * The code has also been compartmentalized into several entities that
- * should make algorithmic experimentation easier than with the old
- * code.
+ * The code has also been compartmentalized into several entities that
+ * should make algorithmic experimentation easier than with the old
+ * code.
*
*************************************************************************/
@@ -102,9 +102,9 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * The auto-fitter doesn't need a very high angular accuracy;
- * this allows us to speed up some computations considerably with a
- * light Cordic algorithm (see afangles.c).
+ * The auto-fitter doesn't need a very high angular accuracy;
+ * this allows us to speed up some computations considerably with a
+ * light Cordic algorithm (see afangles.c).
*/
typedef FT_Int AF_Angle;
@@ -118,7 +118,7 @@ extern void* _af_debug_hints;
#if 0
/*
- * compute the angle of a given 2-D vector
+ * compute the angle of a given 2-D vector
*/
FT_LOCAL( AF_Angle )
af_angle_atan( FT_Pos dx,
@@ -126,8 +126,8 @@ extern void* _af_debug_hints;
/*
- * compute `angle2 - angle1'; the result is always within
- * the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
+ * compute `angle2 - angle1'; the result is always within
+ * the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
*/
FT_LOCAL( AF_Angle )
af_angle_diff( AF_Angle angle1,
@@ -150,8 +150,9 @@ extern void* _af_debug_hints;
FT_END_STMNT
- /* opaque handle to glyph-specific hints -- see `afhints.h' for more
- * details
+ /*
+ * opaque handle to glyph-specific hints -- see `afhints.h' for more
+ * details
*/
typedef struct AF_GlyphHintsRec_* AF_GlyphHints;
@@ -165,8 +166,8 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * A scaler models the target pixel device that will receive the
- * auto-hinted glyph image.
+ * A scaler models the target pixel device that will receive the
+ * auto-hinted glyph image.
*/
#define AF_SCALER_FLAG_NO_HORIZONTAL 1U /* disable horizontal hinting */
@@ -197,8 +198,9 @@ extern void* _af_debug_hints;
typedef struct AF_StyleMetricsRec_* AF_StyleMetrics;
- /* This function parses an FT_Face to compute global metrics for
- * a specific style.
+ /*
+ * This function parses an FT_Face to compute global metrics for
+ * a specific style.
*/
typedef FT_Error
(*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics metrics,
@@ -237,22 +239,22 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * For the auto-hinter, a writing system consists of multiple scripts that
- * can be handled similarly *in a typographical way*; the relationship is
- * not based on history. For example, both the Greek and the unrelated
- * Armenian scripts share the same features like ascender, descender,
- * x-height, etc. Essentially, a writing system is covered by a
- * submodule of the auto-fitter; it contains
+ * For the auto-hinter, a writing system consists of multiple scripts that
+ * can be handled similarly *in a typographical way*; the relationship is
+ * not based on history. For example, both the Greek and the unrelated
+ * Armenian scripts share the same features like ascender, descender,
+ * x-height, etc. Essentially, a writing system is covered by a
+ * submodule of the auto-fitter; it contains
*
- * - a specific global analyzer that computes global metrics specific to
- * the script (based on script-specific characters to identify ascender
- * height, x-height, etc.),
+ * - a specific global analyzer that computes global metrics specific to
+ * the script (based on script-specific characters to identify ascender
+ * height, x-height, etc.),
*
- * - a specific glyph analyzer that computes segments and edges for each
- * glyph covered by the script,
+ * - a specific glyph analyzer that computes segments and edges for each
+ * glyph covered by the script,
*
- * - a specific grid-fitting algorithm that distorts the scaled glyph
- * outline according to the results of the glyph analyzer.
+ * - a specific grid-fitting algorithm that distorts the scaled glyph
+ * outline according to the results of the glyph analyzer.
*/
#define AFWRTSYS_H_ /* don't load header files */
@@ -300,12 +302,12 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * Each script is associated with two sets of Unicode ranges to test
- * whether the font face supports the script, and which non-base
- * characters the script contains.
+ * Each script is associated with two sets of Unicode ranges to test
+ * whether the font face supports the script, and which non-base
+ * characters the script contains.
*
- * We use four-letter script tags from the OpenType specification,
- * extended by `NONE', which indicates `no script'.
+ * We use four-letter script tags from the OpenType specification,
+ * extended by `NONE', which indicates `no script'.
*/
#undef SCRIPT
@@ -361,41 +363,41 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * Usually, a font contains more glyphs than can be addressed by its
- * character map.
+ * Usually, a font contains more glyphs than can be addressed by its
+ * character map.
*
- * In the PostScript font world, encoding vectors specific to a given
- * task are used to select such glyphs, and these glyphs can be often
- * recognized by having a suffix in its glyph names. For example, a
- * superscript glyph `A' might be called `A.sup'. Unfortunately, this
- * naming scheme is not standardized and thus unusable for us.
+ * In the PostScript font world, encoding vectors specific to a given
+ * task are used to select such glyphs, and these glyphs can be often
+ * recognized by having a suffix in its glyph names. For example, a
+ * superscript glyph `A' might be called `A.sup'. Unfortunately, this
+ * naming scheme is not standardized and thus unusable for us.
*
- * In the OpenType world, a better solution was invented, namely
- * `features', which cleanly separate a character's input encoding from
- * the corresponding glyph's appearance, and which don't use glyph names
- * at all. For our purposes, and slightly generalized, an OpenType
- * feature is a name of a mapping that maps character codes to
- * non-standard glyph indices (features get used for other things also).
- * For example, the `sups' feature provides superscript glyphs, thus
- * mapping character codes like `A' or `B' to superscript glyph
- * representation forms. How this mapping happens is completely
- * uninteresting to us.
+ * In the OpenType world, a better solution was invented, namely
+ * `features', which cleanly separate a character's input encoding from
+ * the corresponding glyph's appearance, and which don't use glyph names
+ * at all. For our purposes, and slightly generalized, an OpenType
+ * feature is a name of a mapping that maps character codes to
+ * non-standard glyph indices (features get used for other things also).
+ * For example, the `sups' feature provides superscript glyphs, thus
+ * mapping character codes like `A' or `B' to superscript glyph
+ * representation forms. How this mapping happens is completely
+ * uninteresting to us.
*
- * For the auto-hinter, a `coverage' represents all glyphs of an OpenType
- * feature collected in a set (as listed below) that can be hinted
- * together. To continue the above example, superscript glyphs must not
- * be hinted together with normal glyphs because the blue zones
- * completely differ.
+ * For the auto-hinter, a `coverage' represents all glyphs of an OpenType
+ * feature collected in a set (as listed below) that can be hinted
+ * together. To continue the above example, superscript glyphs must not
+ * be hinted together with normal glyphs because the blue zones
+ * completely differ.
*
- * Note that FreeType itself doesn't compute coverages; it only provides
- * the glyphs addressable by the default Unicode character map. Instead,
- * we use the HarfBuzz library (if available), which has many functions
- * exactly for this purpose.
+ * Note that FreeType itself doesn't compute coverages; it only provides
+ * the glyphs addressable by the default Unicode character map. Instead,
+ * we use the HarfBuzz library (if available), which has many functions
+ * exactly for this purpose.
*
- * AF_COVERAGE_DEFAULT is special: It should cover everything that isn't
- * listed separately (including the glyphs addressable by the character
- * map). In case HarfBuzz isn't available, it exactly covers the glyphs
- * addressable by the character map.
+ * AF_COVERAGE_DEFAULT is special: It should cover everything that isn't
+ * listed separately (including the glyphs addressable by the character
+ * map). In case HarfBuzz isn't available, it exactly covers the glyphs
+ * addressable by the character map.
*
*/
@@ -423,8 +425,8 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * The topmost structure for modelling the auto-hinter glyph input data
- * is a `style class', grouping everything together.
+ * The topmost structure for modelling the auto-hinter glyph input data
+ * is a `style class', grouping everything together.
*/
#undef STYLE
@@ -486,8 +488,6 @@ extern void* _af_debug_hints;
/* Declare and define vtables for classes */
-#ifndef FT_CONFIG_OPTION_PIC
-
#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
FT_CALLBACK_TABLE const AF_WritingSystemClassRec \
writing_system_class;
@@ -562,87 +562,9 @@ extern void* _af_debug_hints;
coverage \
};
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
- FT_LOCAL( void ) \
- FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac );
-
-#define AF_DEFINE_WRITING_SYSTEM_CLASS( \
- writing_system_class, \
- system, \
- m_size, \
- m_init, \
- m_scale, \
- m_done, \
- m_stdw, \
- h_init, \
- h_apply ) \
- FT_LOCAL_DEF( void ) \
- FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \
- { \
- ac->writing_system = system; \
- \
- ac->style_metrics_size = m_size; \
- \
- ac->style_metrics_init = m_init; \
- ac->style_metrics_scale = m_scale; \
- ac->style_metrics_done = m_done; \
- ac->style_metrics_getstdw = m_stdw; \
- \
- ac->style_hints_init = h_init; \
- ac->style_hints_apply = h_apply; \
- }
-
-
-#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
- FT_LOCAL( void ) \
- FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac );
-
-#define AF_DEFINE_SCRIPT_CLASS( \
- script_class, \
- script_, \
- ranges, \
- nonbase_ranges, \
- top_to_bottom, \
- std_charstring ) \
- FT_LOCAL_DEF( void ) \
- FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
- { \
- ac->script = script_; \
- ac->script_uni_ranges = ranges; \
- ac->script_uni_nonbase_ranges = nonbase_ranges; \
- ac->top_to_bottom_hinting = top_to_bottom; \
- ac->standard_charstring = std_charstring; \
- }
-
-
-#define AF_DECLARE_STYLE_CLASS( style_class ) \
- FT_LOCAL( void ) \
- FT_Init_Class_ ## style_class( AF_StyleClassRec* ac );
-
-#define AF_DEFINE_STYLE_CLASS( \
- style_class, \
- style_, \
- writing_system_, \
- script_, \
- blue_stringset_, \
- coverage_ ) \
- FT_LOCAL_DEF( void ) \
- FT_Init_Class_ ## style_class( AF_StyleClassRec* ac ) \
- { \
- ac->style = style_; \
- ac->writing_system = writing_system_; \
- ac->script = script_; \
- ac->blue_stringset = blue_stringset_; \
- ac->coverage = coverage_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
/* */
+
FT_END_HEADER
#endif /* AFTYPES_H_ */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c
index 2a75ea7b35f..84e9753ad99 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c
@@ -1,40 +1,40 @@
-/***************************************************************************/
-/* */
-/* afwarp.c */
-/* */
-/* Auto-fitter warping algorithm (body). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afwarp.c
+ *
+ * Auto-fitter warping algorithm (body).
+ *
+ * Copyright (C) 2006-2019 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.
+ * 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_afwarp
+#define FT_COMPONENT afwarp
/* The weights cover the range 0/64 - 63/64 of a pixel. Obviously, */
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h
index 520b1be907c..9a2c9a42c1b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afwarp.h */
-/* */
-/* Auto-fitter warping algorithm (specification). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afwarp.h
+ *
+ * Auto-fitter warping algorithm (specification).
+ *
+ * Copyright (C) 2006-2019 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_
@@ -47,12 +47,14 @@ FT_BEGIN_HEADER
} 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_Fixed *a_delta );
+ FT_Pos *a_delta );
+#endif
FT_END_HEADER
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h
index 4675f3242d1..5611cf441a4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afwrtsys.h */
-/* */
-/* Auto-fitter writing systems (specification only). */
-/* */
-/* Copyright 2013-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afwrtsys.h
+ *
+ * Auto-fitter writing systems (specification only).
+ *
+ * Copyright (C) 2013-2019 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_
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c b/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c
index c1605160a1c..facfec17444 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* autofit.c */
-/* */
-/* Auto-fitter module (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * autofit.c
+ *
+ * Auto-fitter module (body).
+ *
+ * Copyright (C) 2003-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -30,7 +30,6 @@
#include "aflatin2.c"
#include "afloader.c"
#include "afmodule.c"
-#include "afpic.c"
#include "afranges.c"
#include "afshaper.c"
#include "afwarp.c"
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk b/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk
index ff05f83e7ec..cf77b169f72 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2018 by
+# Copyright (C) 2003-2019 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/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk b/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk
index 75171b412cf..c59da33a555 100644
--- a/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2018 by
+# Copyright (C) 2003-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -38,7 +38,6 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
$(AUTOF_DIR)/aflatin.c \
$(AUTOF_DIR)/afloader.c \
$(AUTOF_DIR)/afmodule.c \
- $(AUTOF_DIR)/afpic.c \
$(AUTOF_DIR)/afranges.c \
$(AUTOF_DIR)/afshaper.c \
$(AUTOF_DIR)/afwarp.c
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/Jamfile b/Build/source/libs/freetype2/freetype-src/src/base/Jamfile
index 4994c1b4caa..8e1ec42756b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/base/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/base Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,9 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
_sources = basepic
ftadvanc
ftcalc
+ ftcolor
ftdbgmem
+ fterrors
ftfntfmt
ftgloadr
fthash
@@ -47,8 +49,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
# Add the optional/replaceable files.
#
{
- local _sources = ftapi
- ftbbox
+ local _sources = ftbbox
ftbdf
ftbitmap
ftcid
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/basepic.c b/Build/source/libs/freetype2/freetype-src/src/base/basepic.c
deleted file mode 100644
index bc804064416..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/base/basepic.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/***************************************************************************/
-/* */
-/* basepic.c */
-/* */
-/* The FreeType position independent code services for base. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "basepic.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from ftglyph.c */
- void
- FT_Init_Class_ft_outline_glyph_class( FT_Glyph_Class* clazz );
-
- void
- FT_Init_Class_ft_bitmap_glyph_class( FT_Glyph_Class* clazz );
-
-#ifdef FT_CONFIG_OPTION_MAC_FONTS
- /* forward declaration of PIC init function from ftrfork.c */
- /* (not modularized) */
- void
- FT_Init_Table_ft_raccess_guess_table( ft_raccess_guess_rec* record );
-#endif
-
- /* forward declaration of PIC init functions from ftinit.c */
- FT_Error
- ft_create_default_module_classes( FT_Library library );
-
- void
- ft_destroy_default_module_classes( FT_Library library );
-
-
- void
- ft_base_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->base )
- {
- /* destroy default module classes */
- /* (in case FT_Add_Default_Modules was used) */
- ft_destroy_default_module_classes( library );
-
- FT_FREE( pic_container->base );
- pic_container->base = NULL;
- }
- }
-
-
- FT_Error
- ft_base_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- BasePIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->base = container;
-
- /* initialize default modules list and pointers */
- error = ft_create_default_module_classes( library );
- if ( error )
- goto Exit;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- FT_Init_Class_ft_outline_glyph_class(
- &container->ft_outline_glyph_class );
- FT_Init_Class_ft_bitmap_glyph_class(
- &container->ft_bitmap_glyph_class );
-#ifdef FT_CONFIG_OPTION_MAC_FONTS
- FT_Init_Table_ft_raccess_guess_table(
- (ft_raccess_guess_rec*)&container->ft_raccess_guess_table );
-#endif
-
- Exit:
- if ( error )
- ft_base_pic_free( library );
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/basepic.h b/Build/source/libs/freetype2/freetype-src/src/base/basepic.h
deleted file mode 100644
index 492d1ede564..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/base/basepic.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************/
-/* */
-/* basepic.h */
-/* */
-/* The FreeType position independent code services for base. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 BASEPIC_H_
-#define BASEPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_OUTLINE_GLYPH_CLASS_GET &ft_outline_glyph_class
-#define FT_BITMAP_GLYPH_CLASS_GET &ft_bitmap_glyph_class
-#define FT_DEFAULT_MODULES_GET ft_default_modules
-
-#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
-#define FT_RACCESS_GUESS_TABLE_GET ft_raccess_guess_table
-#endif
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#include FT_GLYPH_H
-
-#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
-#include FT_INTERNAL_RFORK_H
-#endif
-
-
-FT_BEGIN_HEADER
-
- typedef struct BasePIC_
- {
- FT_Module_Class** default_module_classes;
- FT_Glyph_Class ft_outline_glyph_class;
- FT_Glyph_Class ft_bitmap_glyph_class;
-
-#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
- ft_raccess_guess_rec ft_raccess_guess_table[FT_RACCESS_N_RULES];
-#endif
-
- } BasePIC;
-
-
-#define GET_PIC( lib ) ( (BasePIC*)( (lib)->pic_container.base ) )
-
-#define FT_OUTLINE_GLYPH_CLASS_GET \
- ( &GET_PIC( library )->ft_outline_glyph_class )
-#define FT_BITMAP_GLYPH_CLASS_GET \
- ( &GET_PIC( library )->ft_bitmap_glyph_class )
-#define FT_DEFAULT_MODULES_GET \
- ( GET_PIC( library )->default_module_classes )
-
-#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
-#define FT_RACCESS_GUESS_TABLE_GET \
- ( GET_PIC( library )->ft_raccess_guess_table )
-#endif
-
-
- /* see basepic.c for the implementation */
- void
- ft_base_pic_free( FT_Library library );
-
- FT_Error
- ft_base_pic_init( FT_Library library );
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* BASEPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftadvanc.c b/Build/source/libs/freetype2/freetype-src/src/base/ftadvanc.c
index 230c84d6ad4..0dfba57036e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftadvanc.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftadvanc.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftadvanc.c */
-/* */
-/* Quick computation of advance widths (body). */
-/* */
-/* Copyright 2008-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftadvanc.c
+ *
+ * Quick computation of advance widths (body).
+ *
+ * Copyright (C) 2008-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftapi.c b/Build/source/libs/freetype2/freetype-src/src/base/ftapi.c
deleted file mode 100644
index 32d6e95d199..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftapi.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftapi.c */
-/* */
-/* The FreeType compatibility functions (body). */
-/* */
-/* Copyright 2002-2018 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 <ft2build.h>
-#include FT_LIST_H
-#include FT_OUTLINE_H
-#include FT_INTERNAL_OBJECTS_H
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_STREAM_H
-#include FT_TRUETYPE_TABLES_H
-#include FT_OUTLINE_H
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** C O M P A T I B I L I T Y ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /* backward compatibility API */
-
- FT_BASE_DEF( void )
- FT_New_Memory_Stream( FT_Library library,
- FT_Byte* base,
- FT_ULong size,
- FT_Stream stream )
- {
- FT_UNUSED( library );
-
- FT_Stream_OpenMemory( stream, base, size );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_Seek_Stream( FT_Stream stream,
- FT_ULong pos )
- {
- return FT_Stream_Seek( stream, pos );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_Skip_Stream( FT_Stream stream,
- FT_Long distance )
- {
- return FT_Stream_Skip( stream, distance );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_Read_Stream( FT_Stream stream,
- FT_Byte* buffer,
- FT_ULong count )
- {
- return FT_Stream_Read( stream, buffer, count );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_Read_Stream_At( FT_Stream stream,
- FT_ULong pos,
- FT_Byte* buffer,
- FT_ULong count )
- {
- return FT_Stream_ReadAt( stream, pos, buffer, count );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_Extract_Frame( FT_Stream stream,
- FT_ULong count,
- FT_Byte** pbytes )
- {
- return FT_Stream_ExtractFrame( stream, count, pbytes );
- }
-
-
- FT_BASE_DEF( void )
- FT_Release_Frame( FT_Stream stream,
- FT_Byte** pbytes )
- {
- FT_Stream_ReleaseFrame( stream, pbytes );
- }
-
- FT_BASE_DEF( FT_Error )
- FT_Access_Frame( FT_Stream stream,
- FT_ULong count )
- {
- return FT_Stream_EnterFrame( stream, count );
- }
-
-
- FT_BASE_DEF( void )
- FT_Forget_Frame( FT_Stream stream )
- {
- FT_Stream_ExitFrame( stream );
- }
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftbase.c b/Build/source/libs/freetype2/freetype-src/src/base/ftbase.c
index f914b9b247b..fb8cbfcc271 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftbase.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftbase.c
@@ -1,28 +1,29 @@
-/***************************************************************************/
-/* */
-/* ftbase.c */
-/* */
-/* Single object library component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftbase.c
+ *
+ * Single object library component (body only).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
#define FT_MAKE_OPTION_SINGLE_OBJECT
-#include "basepic.c"
#include "ftadvanc.c"
#include "ftcalc.c"
+#include "ftcolor.c"
#include "ftdbgmem.c"
+#include "fterrors.c"
#include "ftfntfmt.c"
#include "ftgloadr.c"
#include "fthash.c"
@@ -30,7 +31,6 @@
#include "ftmac.c"
#include "ftobjs.c"
#include "ftoutln.c"
-#include "ftpic.c"
#include "ftpsprop.c"
#include "ftrfork.c"
#include "ftsnames.c"
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftbase.h b/Build/source/libs/freetype2/freetype-src/src/base/ftbase.h
index 7e8cfad9590..35b1c47fd9c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftbase.h
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftbase.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftbase.h */
-/* */
-/* Private functions used in the `base' module (specification). */
-/* */
-/* Copyright 2008-2018 by */
-/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftbase.h
+ *
+ * Private functions used in the `base' module (specification).
+ *
+ * Copyright (C) 2008-2019 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
+ *
+ * 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 FTBASE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftbbox.c b/Build/source/libs/freetype2/freetype-src/src/base/ftbbox.c
index 151e85c97a5..0b04fde6359 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftbbox.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftbbox.c
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* ftbbox.c */
-/* */
-/* FreeType bbox computation (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used */
-/* modified and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This component has a _single_ role: to compute exact outline bounding */
- /* boxes. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftbbox.c
+ *
+ * FreeType bbox computation (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used
+ * modified and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This component has a _single_ role: to compute exact outline bounding
+ * boxes.
+ *
+ */
#include <ft2build.h>
@@ -61,26 +61,28 @@
( p->y < bbox.yMin || p->y > bbox.yMax )
- /*************************************************************************/
- /* */
- /* <Function> */
- /* BBox_Move_To */
- /* */
- /* <Description> */
- /* This function is used as a `move_to' emitter during */
- /* FT_Outline_Decompose(). It simply records the destination point */
- /* in `user->last'. We also update bbox in case contour starts with */
- /* an implicit `on' point. */
- /* */
- /* <Input> */
- /* to :: A pointer to the destination vector. */
- /* */
- /* <InOut> */
- /* user :: A pointer to the current walk context. */
- /* */
- /* <Return> */
- /* Always 0. Needed for the interface only. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * BBox_Move_To
+ *
+ * @Description:
+ * This function is used as a `move_to' emitter during
+ * FT_Outline_Decompose(). It simply records the destination point
+ * in `user->last'. We also update bbox in case contour starts with
+ * an implicit `on' point.
+ *
+ * @Input:
+ * to ::
+ * A pointer to the destination vector.
+ *
+ * @InOut:
+ * user ::
+ * A pointer to the current walk context.
+ *
+ * @Return:
+ * Always 0. Needed for the interface only.
+ */
static int
BBox_Move_To( FT_Vector* to,
TBBox_Rec* user )
@@ -93,26 +95,28 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* BBox_Line_To */
- /* */
- /* <Description> */
- /* This function is used as a `line_to' emitter during */
- /* FT_Outline_Decompose(). It simply records the destination point */
- /* in `user->last'; no further computations are necessary because */
- /* bbox already contains both explicit ends of the line segment. */
- /* */
- /* <Input> */
- /* to :: A pointer to the destination vector. */
- /* */
- /* <InOut> */
- /* user :: A pointer to the current walk context. */
- /* */
- /* <Return> */
- /* Always 0. Needed for the interface only. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * BBox_Line_To
+ *
+ * @Description:
+ * This function is used as a `line_to' emitter during
+ * FT_Outline_Decompose(). It simply records the destination point
+ * in `user->last'; no further computations are necessary because
+ * bbox already contains both explicit ends of the line segment.
+ *
+ * @Input:
+ * to ::
+ * A pointer to the destination vector.
+ *
+ * @InOut:
+ * user ::
+ * A pointer to the current walk context.
+ *
+ * @Return:
+ * Always 0. Needed for the interface only.
+ */
static int
BBox_Line_To( FT_Vector* to,
TBBox_Rec* user )
@@ -123,28 +127,33 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* BBox_Conic_Check */
- /* */
- /* <Description> */
- /* Find the extrema of a 1-dimensional conic Bezier curve and update */
- /* a bounding range. This version uses direct computation, as it */
- /* doesn't need square roots. */
- /* */
- /* <Input> */
- /* y1 :: The start coordinate. */
- /* */
- /* y2 :: The coordinate of the control point. */
- /* */
- /* y3 :: The end coordinate. */
- /* */
- /* <InOut> */
- /* min :: The address of the current minimum. */
- /* */
- /* max :: The address of the current maximum. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * BBox_Conic_Check
+ *
+ * @Description:
+ * Find the extrema of a 1-dimensional conic Bezier curve and update
+ * a bounding range. This version uses direct computation, as it
+ * doesn't need square roots.
+ *
+ * @Input:
+ * y1 ::
+ * The start coordinate.
+ *
+ * y2 ::
+ * The coordinate of the control point.
+ *
+ * y3 ::
+ * The end coordinate.
+ *
+ * @InOut:
+ * min ::
+ * The address of the current minimum.
+ *
+ * max ::
+ * The address of the current maximum.
+ */
static void
BBox_Conic_Check( FT_Pos y1,
FT_Pos y2,
@@ -168,32 +177,35 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* BBox_Conic_To */
- /* */
- /* <Description> */
- /* This function is used as a `conic_to' emitter during */
- /* FT_Outline_Decompose(). It checks a conic Bezier curve with the */
- /* current bounding box, and computes its extrema if necessary to */
- /* update it. */
- /* */
- /* <Input> */
- /* control :: A pointer to a control point. */
- /* */
- /* to :: A pointer to the destination vector. */
- /* */
- /* <InOut> */
- /* user :: The address of the current walk context. */
- /* */
- /* <Return> */
- /* Always 0. Needed for the interface only. */
- /* */
- /* <Note> */
- /* In the case of a non-monotonous arc, we compute directly the */
- /* extremum coordinates, as it is sufficiently fast. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * BBox_Conic_To
+ *
+ * @Description:
+ * This function is used as a `conic_to' emitter during
+ * FT_Outline_Decompose(). It checks a conic Bezier curve with the
+ * current bounding box, and computes its extrema if necessary to
+ * update it.
+ *
+ * @Input:
+ * control ::
+ * A pointer to a control point.
+ *
+ * to ::
+ * A pointer to the destination vector.
+ *
+ * @InOut:
+ * user ::
+ * The address of the current walk context.
+ *
+ * @Return:
+ * Always 0. Needed for the interface only.
+ *
+ * @Note:
+ * In the case of a non-monotonous arc, we compute directly the
+ * extremum coordinates, as it is sufficiently fast.
+ */
static int
BBox_Conic_To( FT_Vector* control,
FT_Vector* to,
@@ -222,30 +234,36 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* BBox_Cubic_Check */
- /* */
- /* <Description> */
- /* Find the extrema of a 1-dimensional cubic Bezier curve and */
- /* update a bounding range. This version uses iterative splitting */
- /* because it is faster than the exact solution with square roots. */
- /* */
- /* <Input> */
- /* p1 :: The start coordinate. */
- /* */
- /* p2 :: The coordinate of the first control point. */
- /* */
- /* p3 :: The coordinate of the second control point. */
- /* */
- /* p4 :: The end coordinate. */
- /* */
- /* <InOut> */
- /* min :: The address of the current minimum. */
- /* */
- /* max :: The address of the current maximum. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * BBox_Cubic_Check
+ *
+ * @Description:
+ * Find the extrema of a 1-dimensional cubic Bezier curve and
+ * update a bounding range. This version uses iterative splitting
+ * because it is faster than the exact solution with square roots.
+ *
+ * @Input:
+ * p1 ::
+ * The start coordinate.
+ *
+ * p2 ::
+ * The coordinate of the first control point.
+ *
+ * p3 ::
+ * The coordinate of the second control point.
+ *
+ * p4 ::
+ * The end coordinate.
+ *
+ * @InOut:
+ * min ::
+ * The address of the current minimum.
+ *
+ * max ::
+ * The address of the current maximum.
+ */
static FT_Pos
cubic_peak( FT_Pos q1,
FT_Pos q2,
@@ -361,34 +379,38 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* BBox_Cubic_To */
- /* */
- /* <Description> */
- /* This function is used as a `cubic_to' emitter during */
- /* FT_Outline_Decompose(). It checks a cubic Bezier curve with the */
- /* current bounding box, and computes its extrema if necessary to */
- /* update it. */
- /* */
- /* <Input> */
- /* control1 :: A pointer to the first control point. */
- /* */
- /* control2 :: A pointer to the second control point. */
- /* */
- /* to :: A pointer to the destination vector. */
- /* */
- /* <InOut> */
- /* user :: The address of the current walk context. */
- /* */
- /* <Return> */
- /* Always 0. Needed for the interface only. */
- /* */
- /* <Note> */
- /* In the case of a non-monotonous arc, we don't compute directly */
- /* extremum coordinates, we subdivide instead. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * BBox_Cubic_To
+ *
+ * @Description:
+ * This function is used as a `cubic_to' emitter during
+ * FT_Outline_Decompose(). It checks a cubic Bezier curve with the
+ * current bounding box, and computes its extrema if necessary to
+ * update it.
+ *
+ * @Input:
+ * control1 ::
+ * A pointer to the first control point.
+ *
+ * control2 ::
+ * A pointer to the second control point.
+ *
+ * to ::
+ * A pointer to the destination vector.
+ *
+ * @InOut:
+ * user ::
+ * The address of the current walk context.
+ *
+ * @Return:
+ * Always 0. Needed for the interface only.
+ *
+ * @Note:
+ * In the case of a non-monotonous arc, we don't compute directly
+ * extremum coordinates, we subdivide instead.
+ */
static int
BBox_Cubic_To( FT_Vector* control1,
FT_Vector* control2,
@@ -490,12 +512,6 @@
FT_Error error;
TBBox_Rec user;
-#ifdef FT_CONFIG_OPTION_PIC
- FT_Outline_Funcs bbox_interface;
-
-
- Init_Class_bbox_interface( &bbox_interface );
-#endif
user.bbox = bbox;
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftbdf.c b/Build/source/libs/freetype2/freetype-src/src/base/ftbdf.c
index c4ea502fbc2..c0fccd7b7c6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftbdf.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftbdf.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftbdf.c */
-/* */
-/* FreeType API for accessing BDF-specific strings (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftbdf.c
+ *
+ * FreeType API for accessing BDF-specific strings (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftbitmap.c b/Build/source/libs/freetype2/freetype-src/src/base/ftbitmap.c
index a9746663faa..1bdcd9eff3e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftbitmap.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftbitmap.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftbitmap.c */
-/* */
-/* FreeType utility functions for bitmaps (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftbitmap.c
+ *
+ * FreeType utility functions for bitmaps (body).
+ *
+ * Copyright (C) 2004-2019 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 <ft2build.h>
@@ -24,8 +24,18 @@
#include FT_INTERNAL_OBJECTS_H
+ /**************************************************************************
+ *
+ * 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 bitmap
+
+
static
- const FT_Bitmap null_bitmap = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ const FT_Bitmap null_bitmap = { 0, 0, 0, NULL, 0, 0, 0, NULL };
/* documentation is in ftbitmap.h */
@@ -786,6 +796,331 @@
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( 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 )
+ {
+ FT_Error error = FT_Err_Ok;
+ FT_Memory memory;
+
+ FT_Bitmap source_bitmap;
+ const FT_Bitmap* source;
+
+ FT_Vector source_offset;
+ FT_Vector target_offset;
+
+ FT_Bool free_source_bitmap = 0;
+ FT_Bool free_target_bitmap_on_error = 0;
+
+ FT_Pos source_llx, source_lly, source_urx, source_ury;
+ FT_Pos target_llx, target_lly, target_urx, target_ury;
+ FT_Pos final_llx, final_lly, final_urx, final_ury;
+
+ unsigned int final_rows, final_width;
+ long x, y;
+
+
+ if ( !library || !target || !source_ || !atarget_offset )
+ return FT_THROW( Invalid_Argument );
+
+ memory = library->memory;
+
+ if ( !( target->pixel_mode == FT_PIXEL_MODE_NONE ||
+ ( target->pixel_mode == FT_PIXEL_MODE_BGRA &&
+ target->buffer ) ) )
+ return FT_THROW( Invalid_Argument );
+
+ if ( source_->pixel_mode == FT_PIXEL_MODE_NONE )
+ return FT_Err_Ok; /* nothing to do */
+
+ /* pitches must have the same sign */
+ if ( target->pixel_mode == FT_PIXEL_MODE_BGRA &&
+ ( source_->pitch ^ target->pitch ) < 0 )
+ return FT_THROW( Invalid_Argument );
+
+ if ( !( source_->width && source_->rows ) )
+ return FT_Err_Ok; /* nothing to do */
+
+ /* assure integer pixel offsets */
+ source_offset.x = FT_PIX_FLOOR( source_offset_.x );
+ source_offset.y = FT_PIX_FLOOR( source_offset_.y );
+ target_offset.x = FT_PIX_FLOOR( atarget_offset->x );
+ target_offset.y = FT_PIX_FLOOR( atarget_offset->y );
+
+ /* get source bitmap dimensions */
+ source_llx = source_offset.x;
+ if ( FT_LONG_MIN + (FT_Pos)( source_->rows << 6 ) + 64 > source_offset.y )
+ {
+ FT_TRACE5((
+ "FT_Bitmap_Blend: y coordinate overflow in source bitmap\n" ));
+ return FT_THROW( Invalid_Argument );
+ }
+ source_lly = source_offset.y - ( source_->rows << 6 );
+
+ if ( FT_LONG_MAX - (FT_Pos)( source_->width << 6 ) - 64 < source_llx )
+ {
+ FT_TRACE5((
+ "FT_Bitmap_Blend: x coordinate overflow in source bitmap\n" ));
+ return FT_THROW( Invalid_Argument );
+ }
+ source_urx = source_llx + ( source_->width << 6 );
+ source_ury = source_offset.y;
+
+ /* get target bitmap dimensions */
+ if ( target->width && target->rows )
+ {
+ target_llx = target_offset.x;
+ if ( FT_LONG_MIN + (FT_Pos)( target->rows << 6 ) > target_offset.y )
+ {
+ FT_TRACE5((
+ "FT_Bitmap_Blend: y coordinate overflow in target bitmap\n" ));
+ return FT_THROW( Invalid_Argument );
+ }
+ target_lly = target_offset.y - ( target->rows << 6 );
+
+ if ( FT_LONG_MAX - (FT_Pos)( target->width << 6 ) < target_llx )
+ {
+ FT_TRACE5((
+ "FT_Bitmap_Blend: x coordinate overflow in target bitmap\n" ));
+ return FT_THROW( Invalid_Argument );
+ }
+ target_urx = target_llx + ( target->width << 6 );
+ target_ury = target_offset.y;
+ }
+ else
+ {
+ target_llx = FT_LONG_MAX;
+ target_lly = FT_LONG_MAX;
+ target_urx = FT_LONG_MIN;
+ target_ury = FT_LONG_MIN;
+ }
+
+ /* compute final bitmap dimensions */
+ final_llx = FT_MIN( source_llx, target_llx );
+ final_lly = FT_MIN( source_lly, target_lly );
+ final_urx = FT_MAX( source_urx, target_urx );
+ final_ury = FT_MAX( source_ury, target_ury );
+
+ final_width = ( final_urx - final_llx ) >> 6;
+ final_rows = ( final_ury - final_lly ) >> 6;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE5(( "FT_Bitmap_Blend:\n"
+ " source bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
+ source_llx / 64, source_lly / 64,
+ source_urx / 64, source_ury / 64,
+ source_->width, source_->rows ));
+
+ if ( target->width && target->rows )
+ FT_TRACE5(( " target bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
+ target_llx / 64, target_lly / 64,
+ target_urx / 64, target_ury / 64,
+ target->width, target->rows ));
+ else
+ FT_TRACE5(( " target bitmap: empty\n" ));
+
+ FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
+ final_llx / 64, final_lly / 64,
+ final_urx / 64, final_ury / 64,
+ final_width, final_rows ));
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+ /* for blending, set offset vector of final bitmap */
+ /* temporarily to (0,0) */
+ source_llx -= final_llx;
+ source_lly -= final_lly;
+
+ if ( target->width && target->rows )
+ {
+ target_llx -= final_llx;
+ target_lly -= final_lly;
+ }
+
+ /* set up target bitmap */
+ if ( target->pixel_mode == FT_PIXEL_MODE_NONE )
+ {
+ /* create new empty bitmap */
+ target->width = final_width;
+ target->rows = final_rows;
+ target->pixel_mode = FT_PIXEL_MODE_BGRA;
+ target->pitch = (int)final_width * 4;
+ target->num_grays = 256;
+
+ if ( FT_LONG_MAX / target->pitch < (int)target->rows )
+ {
+ FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
+ final_width, final_rows ));
+ return FT_THROW( Invalid_Argument );
+ }
+
+ if ( FT_ALLOC( target->buffer, target->pitch * (int)target->rows ) )
+ return error;
+
+ free_target_bitmap_on_error = 1;
+ }
+ else if ( target->width != final_width ||
+ target->rows != final_rows )
+ {
+ /* adjust old bitmap to enlarged size */
+ int pitch, new_pitch;
+
+ unsigned char* buffer = NULL;
+
+
+ pitch = target->pitch;
+ if ( pitch < 0 )
+ pitch = -pitch;
+
+ new_pitch = (int)final_width * 4;
+
+ if ( FT_LONG_MAX / new_pitch < (int)final_rows )
+ {
+ FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
+ final_width, final_rows ));
+ return FT_THROW( Invalid_Argument );
+ }
+
+ /* TODO: provide an in-buffer solution for large bitmaps */
+ /* to avoid allocation of a new buffer */
+ if ( FT_ALLOC( buffer, new_pitch * (int)final_rows ) )
+ goto Error;
+
+ /* copy data to new buffer */
+ x = target_llx >> 6;
+ y = target_lly >> 6;
+
+ /* the bitmap flow is from top to bottom, */
+ /* but y is measured from bottom to top */
+ if ( target->pitch < 0 )
+ {
+ /* XXX */
+ }
+ else
+ {
+ unsigned char* p =
+ target->buffer;
+ unsigned char* q =
+ buffer +
+ ( final_rows - y - target->rows ) * new_pitch +
+ x * 4;
+ unsigned char* limit_p =
+ p + pitch * (int)target->rows;
+
+
+ while ( p < limit_p )
+ {
+ FT_MEM_COPY( q, p, pitch );
+
+ p += pitch;
+ q += new_pitch;
+ }
+ }
+
+ FT_FREE( target->buffer );
+
+ target->width = final_width;
+ target->rows = final_rows;
+
+ if ( target->pitch < 0 )
+ target->pitch = -new_pitch;
+ else
+ target->pitch = new_pitch;
+
+ target->buffer = buffer;
+ }
+
+ /* adjust source bitmap if necessary */
+ if ( source_->pixel_mode != FT_PIXEL_MODE_GRAY )
+ {
+ FT_Bitmap_Init( &source_bitmap );
+ error = FT_Bitmap_Convert( library, source_, &source_bitmap, 1 );
+ if ( error )
+ goto Error;
+
+ source = &source_bitmap;
+ free_source_bitmap = 1;
+ }
+ else
+ source = source_;
+
+ /* do blending; the code below returns pre-multiplied channels, */
+ /* similar to what FreeType gets from `CBDT' tables */
+ x = source_llx >> 6;
+ y = source_lly >> 6;
+
+ /* the bitmap flow is from top to bottom, */
+ /* but y is measured from bottom to top */
+ if ( target->pitch < 0 )
+ {
+ /* XXX */
+ }
+ else
+ {
+ unsigned char* p =
+ source->buffer;
+ unsigned char* q =
+ target->buffer +
+ ( target->rows - y - source->rows ) * target->pitch +
+ x * 4;
+ unsigned char* limit_p =
+ p + source->pitch * (int)source->rows;
+
+
+ while ( p < limit_p )
+ {
+ unsigned char* r = p;
+ unsigned char* s = q;
+ unsigned char* limit_r = r + source->width;
+
+
+ while ( r < limit_r )
+ {
+ int aa = *r++;
+ int fa = color.alpha * aa / 255;
+
+ int fb = color.blue * fa / 255;
+ int fg = color.green * fa / 255;
+ int fr = color.red * fa / 255;
+
+ int ba2 = 255 - fa;
+
+ int bb = s[0];
+ int bg = s[1];
+ int br = s[2];
+ int ba = s[3];
+
+
+ *s++ = (unsigned char)( bb * ba2 / 255 + fb );
+ *s++ = (unsigned char)( bg * ba2 / 255 + fg );
+ *s++ = (unsigned char)( br * ba2 / 255 + fr );
+ *s++ = (unsigned char)( ba * ba2 / 255 + fa );
+ }
+
+ p += source->pitch;
+ q += target->pitch;
+ }
+ }
+
+ atarget_offset->x = final_llx;
+ atarget_offset->y = final_lly + ( final_rows << 6 );
+
+ Error:
+ if ( error && free_target_bitmap_on_error )
+ FT_Bitmap_Done( library, target );
+
+ if ( free_source_bitmap )
+ FT_Bitmap_Done( library, &source_bitmap );
+
+ return error;
+ }
+
+
+ /* documentation is in ftbitmap.h */
+
+ FT_EXPORT_DEF( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot )
{
if ( slot && slot->format == FT_GLYPH_FORMAT_BITMAP &&
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftcalc.c b/Build/source/libs/freetype2/freetype-src/src/base/ftcalc.c
index f4ff45f8ef1..315dc441856 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftcalc.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftcalc.c
@@ -1,35 +1,35 @@
-/***************************************************************************/
-/* */
-/* ftcalc.c */
-/* */
-/* Arithmetic computations (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Support for 1-complement arithmetic has been totally dropped in this */
- /* release. You can still write your own code if you need it. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Implementing basic computation routines. */
- /* */
- /* FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(), */
- /* and FT_FloorFix() are declared in freetype.h. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftcalc.c
+ *
+ * Arithmetic computations (body).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * Support for 1-complement arithmetic has been totally dropped in this
+ * release. You can still write your own code if you need it.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * Implementing basic computation routines.
+ *
+ * FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(),
+ * and FT_FloorFix() are declared in freetype.h.
+ *
+ */
#include <ft2build.h>
@@ -58,14 +58,14 @@
#endif /* !FT_LONG64 */
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_calc
+#define FT_COMPONENT calc
/* transfer sign, leaving a positive number; */
@@ -516,10 +516,10 @@
#elif 0
/*
- * This code is nonportable. See comment below.
+ * This code is nonportable. See comment below.
*
- * However, on a platform where right-shift of a signed quantity fills
- * the leftmost bits by copying the sign bit, it might be faster.
+ * However, on a platform where right-shift of a signed quantity fills
+ * the leftmost bits by copying the sign bit, it might be faster.
*/
FT_Long sa, sb;
@@ -527,22 +527,22 @@
/*
- * This is a clever way of converting a signed number `a' into its
- * absolute value (stored back into `a') and its sign. The sign is
- * stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'
- * was negative. (Similarly for `b' and `sb').
+ * This is a clever way of converting a signed number `a' into its
+ * absolute value (stored back into `a') and its sign. The sign is
+ * stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'
+ * was negative. (Similarly for `b' and `sb').
*
- * Unfortunately, it doesn't work (at least not portably).
+ * Unfortunately, it doesn't work (at least not portably).
*
- * It makes the assumption that right-shift on a negative signed value
- * fills the leftmost bits by copying the sign bit. This is wrong.
- * According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
- * the result of right-shift of a negative signed value is
- * implementation-defined. At least one implementation fills the
- * leftmost bits with 0s (i.e., it is exactly the same as an unsigned
- * right shift). This means that when `a' is negative, `sa' ends up
- * with the value 1 rather than -1. After that, everything else goes
- * wrong.
+ * It makes the assumption that right-shift on a negative signed value
+ * fills the leftmost bits by copying the sign bit. This is wrong.
+ * According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
+ * the result of right-shift of a negative signed value is
+ * implementation-defined. At least one implementation fills the
+ * leftmost bits with 0s (i.e., it is exactly the same as an unsigned
+ * right shift). This means that when `a' is negative, `sa' ends up
+ * with the value 1 rather than -1. After that, everything else goes
+ * wrong.
*/
sa = ( a_ >> ( sizeof ( a_ ) * 8 - 1 ) );
a = ( a_ ^ sa ) - sa;
@@ -701,8 +701,8 @@
if ( !delta )
return FT_THROW( Invalid_Argument ); /* matrix can't be inverted */
- matrix->xy = - FT_DivFix( matrix->xy, delta );
- matrix->yx = - FT_DivFix( matrix->yx, delta );
+ matrix->xy = -FT_DivFix( matrix->xy, delta );
+ matrix->yx = -FT_DivFix( matrix->yx, delta );
xx = matrix->xx;
yy = matrix->yy;
@@ -747,6 +747,76 @@
/* documentation is in ftcalc.h */
+ FT_BASE_DEF( FT_Bool )
+ FT_Matrix_Check( const FT_Matrix* matrix )
+ {
+ FT_Matrix m;
+ FT_Fixed val[4];
+ FT_Fixed nonzero_minval, maxval;
+ FT_Fixed temp1, temp2;
+ FT_UInt i;
+
+
+ if ( !matrix )
+ return 0;
+
+ val[0] = FT_ABS( matrix->xx );
+ val[1] = FT_ABS( matrix->xy );
+ val[2] = FT_ABS( matrix->yx );
+ val[3] = FT_ABS( matrix->yy );
+
+ /*
+ * To avoid overflow, we ensure that each value is not larger than
+ *
+ * int(sqrt(2^31 / 4)) = 23170 ;
+ *
+ * we also check that no value becomes zero if we have to scale.
+ */
+
+ maxval = 0;
+ nonzero_minval = FT_LONG_MAX;
+
+ for ( i = 0; i < 4; i++ )
+ {
+ if ( val[i] > maxval )
+ maxval = val[i];
+ if ( val[i] && val[i] < nonzero_minval )
+ nonzero_minval = val[i];
+ }
+
+ /* we only handle 32bit values */
+ if ( maxval > 0x7FFFFFFFL )
+ return 0;
+
+ if ( maxval > 23170 )
+ {
+ FT_Fixed scale = FT_DivFix( maxval, 23170 );
+
+
+ if ( !FT_DivFix( nonzero_minval, scale ) )
+ return 0; /* value range too large */
+
+ m.xx = FT_DivFix( matrix->xx, scale );
+ m.xy = FT_DivFix( matrix->xy, scale );
+ m.yx = FT_DivFix( matrix->yx, scale );
+ m.yy = FT_DivFix( matrix->yy, scale );
+ }
+ else
+ m = *matrix;
+
+ temp1 = FT_ABS( m.xx * m.yy - m.xy * m.yx );
+ temp2 = m.xx * m.xx + m.xy * m.xy + m.yx * m.yx + m.yy * m.yy;
+
+ if ( temp1 == 0 ||
+ temp2 / temp1 > 50 )
+ return 0;
+
+ return 1;
+ }
+
+
+ /* documentation is in ftcalc.h */
+
FT_BASE_DEF( void )
FT_Vector_Transform_Scaled( FT_Vector* vector,
const FT_Matrix* matrix,
@@ -913,9 +983,13 @@
FT_Pos out_x,
FT_Pos out_y )
{
+ /* we silently ignore overflow errors since such large values */
+ /* lead to even more (harmless) rendering errors later on */
+
#ifdef FT_LONG64
- FT_Int64 delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;
+ FT_Int64 delta = SUB_INT64( MUL_INT64( in_x, out_y ),
+ MUL_INT64( in_y, out_x ) );
return ( delta > 0 ) - ( delta < 0 );
@@ -925,8 +999,6 @@
FT_Int result;
- /* we silently ignore overflow errors, since such large values */
- /* lead to even more (harmless) rendering errors later on */
if ( ADD_LONG( FT_ABS( in_x ), FT_ABS( out_y ) ) <= 131071L &&
ADD_LONG( FT_ABS( in_y ), FT_ABS( out_x ) ) <= 131071L )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftcid.c b/Build/source/libs/freetype2/freetype-src/src/base/ftcid.c
index f5184649bfb..190b23f3571 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftcid.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftcid.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcid.c */
-/* */
-/* FreeType API for accessing CID font information. */
-/* */
-/* Copyright 2007-2018 by */
-/* Derek Clegg and Michael Toftdal. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcid.c
+ *
+ * FreeType API for accessing CID font information.
+ *
+ * Copyright (C) 2007-2019 by
+ * Derek Clegg and Michael Toftdal.
+ *
+ * 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftcolor.c b/Build/source/libs/freetype2/freetype-src/src/base/ftcolor.c
new file mode 100644
index 00000000000..8cb057a3655
--- /dev/null
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftcolor.c
@@ -0,0 +1,157 @@
+/****************************************************************************
+ *
+ * ftcolor.c
+ *
+ * FreeType's glyph color management (body).
+ *
+ * Copyright (C) 2018-2019 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 <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_SFNT_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+#include FT_COLOR_H
+
+
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+
+ static
+ const FT_Palette_Data null_palette_data = { 0, NULL, NULL, 0, NULL };
+
+
+ /* documentation is in ftcolor.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Data_Get( FT_Face face,
+ FT_Palette_Data *apalette_data )
+ {
+ if ( !face )
+ return FT_THROW( Invalid_Face_Handle );
+ if ( !apalette_data)
+ return FT_THROW( Invalid_Argument );
+
+ if ( FT_IS_SFNT( face ) )
+ *apalette_data = ( (TT_Face)face )->palette_data;
+ else
+ *apalette_data = null_palette_data;
+
+ return FT_Err_Ok;
+ }
+
+
+ /* documentation is in ftcolor.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Select( FT_Face face,
+ FT_UShort palette_index,
+ FT_Color* *apalette )
+ {
+ FT_Error error;
+
+ TT_Face ttface;
+ SFNT_Service sfnt;
+
+
+ if ( !face )
+ return FT_THROW( Invalid_Face_Handle );
+
+ if ( !FT_IS_SFNT( face ) )
+ {
+ if ( apalette )
+ *apalette = NULL;
+
+ return FT_Err_Ok;
+ }
+
+ ttface = (TT_Face)face;
+ sfnt = (SFNT_Service)ttface->sfnt;
+
+ error = sfnt->set_palette( ttface, palette_index );
+ if ( error )
+ return error;
+
+ ttface->palette_index = palette_index;
+
+ if ( apalette )
+ *apalette = ttface->palette;
+
+ return FT_Err_Ok;
+ }
+
+
+ /* documentation is in ftcolor.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Set_Foreground_Color( FT_Face face,
+ FT_Color foreground_color )
+ {
+ TT_Face ttface;
+
+
+ if ( !face )
+ return FT_THROW( Invalid_Face_Handle );
+
+ if ( !FT_IS_SFNT( face ) )
+ return FT_Err_Ok;
+
+ ttface = (TT_Face)face;
+
+ ttface->foreground_color = foreground_color;
+ ttface->have_foreground_color = 1;
+
+ return FT_Err_Ok;
+ }
+
+#else /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Data_Get( FT_Face face,
+ FT_Palette_Data *apalette_data )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( apalette_data );
+
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Select( FT_Face face,
+ FT_UShort palette_index,
+ FT_Color* *apalette )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( palette_index );
+ FT_UNUSED( apalette );
+
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Set_Foreground_Color( FT_Face face,
+ FT_Color foreground_color )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( foreground_color );
+
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+#endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+
+/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftdbgmem.c b/Build/source/libs/freetype2/freetype-src/src/base/ftdbgmem.c
index c33d8acb4e1..55cd269e1fe 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftdbgmem.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftdbgmem.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftdbgmem.c */
-/* */
-/* Memory debugger (body). */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftdbgmem.c
+ *
+ * Memory debugger (body).
+ *
+ * Copyright (C) 2001-2019 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 <ft2build.h>
@@ -50,9 +50,9 @@
#define FT_MEM_VAL( addr ) ( (FT_PtrDist)(FT_Pointer)( addr ) )
/*
- * This structure holds statistics for a single allocation/release
- * site. This is useful to know where memory operations happen the
- * most.
+ * This structure holds statistics for a single allocation/release
+ * site. This is useful to know where memory operations happen the
+ * most.
*/
typedef struct FT_MemSourceRec_
{
@@ -76,17 +76,17 @@
/*
- * We don't need a resizable array for the memory sources because
- * their number is pretty limited within FreeType.
+ * We don't need a resizable array for the memory sources because
+ * their number is pretty limited within FreeType.
*/
#define FT_MEM_SOURCE_BUCKETS 128
/*
- * This structure holds information related to a single allocated
- * memory block. If KEEPALIVE is defined, blocks that are freed by
- * FreeType are never released to the system. Instead, their `size'
- * field is set to `-size'. This is mainly useful to detect double
- * frees, at the price of a large memory footprint during execution.
+ * This structure holds information related to a single allocated
+ * memory block. If KEEPALIVE is defined, blocks that are freed by
+ * FreeType are never released to the system. Instead, their `size'
+ * field is set to `-size'. This is mainly useful to detect double
+ * frees, at the price of a large memory footprint during execution.
*/
typedef struct FT_MemNodeRec_
{
@@ -106,8 +106,8 @@
/*
- * The global structure, containing compound statistics and all hash
- * tables.
+ * The global structure, containing compound statistics and all hash
+ * tables.
*/
typedef struct FT_MemTableRec_
{
@@ -146,8 +146,8 @@
/*
- * Prime numbers are ugly to handle. It would be better to implement
- * L-Hashing, which is 10% faster and doesn't require divisions.
+ * Prime numbers are ugly to handle. It would be better to implement
+ * L-Hashing, which is 10% faster and doesn't require divisions.
*/
static const FT_Int ft_mem_primes[] =
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftdebug.c b/Build/source/libs/freetype2/freetype-src/src/base/ftdebug.c
index fe263091014..ec723378730 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftdebug.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftdebug.c
@@ -1,44 +1,44 @@
-/***************************************************************************/
-/* */
-/* ftdebug.c */
-/* */
-/* Debugging and logging component (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This component contains various macros and functions used to ease the */
- /* debugging of the FreeType engine. Its main purpose is in assertion */
- /* checking, tracing, and error detection. */
- /* */
- /* There are now three debugging modes: */
- /* */
- /* - trace mode */
- /* */
- /* Error and trace messages are sent to the log file (which can be the */
- /* standard error output). */
- /* */
- /* - error mode */
- /* */
- /* Only error messages are generated. */
- /* */
- /* - release mode: */
- /* */
- /* No error message is sent or generated. The code is free from any */
- /* debugging parts. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftdebug.c
+ *
+ * Debugging and logging component (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This component contains various macros and functions used to ease the
+ * debugging of the FreeType engine. Its main purpose is in assertion
+ * checking, tracing, and error detection.
+ *
+ * There are now three debugging modes:
+ *
+ * - trace mode
+ *
+ * Error and trace messages are sent to the log file (which can be the
+ * standard error output).
+ *
+ * - error mode
+ *
+ * Only error messages are generated.
+ *
+ * - release mode:
+ *
+ * No error message is sent or generated. The code is free from any
+ * debugging parts.
+ *
+ */
#include <ft2build.h>
@@ -87,9 +87,19 @@
int line,
const char* file )
{
+#if 0
+ /* activating the code in this block makes FreeType very chatty */
+ fprintf( stderr,
+ "%s:%d: error 0x%02x: %s\n",
+ file,
+ line,
+ error,
+ FT_Error_String( error ) );
+#else
FT_UNUSED( error );
FT_UNUSED( line );
FT_UNUSED( file );
+#endif
return 0;
}
@@ -100,9 +110,16 @@
#ifdef FT_DEBUG_LEVEL_TRACE
- /* array of trace levels, initialized to 0 */
- int ft_trace_levels[trace_count];
+ /* array of trace levels, initialized to 0; */
+ /* this gets adjusted at run-time */
+ static int ft_trace_levels_enabled[trace_count];
+ /* array of trace levels, always initialized to 0 */
+ static int ft_trace_levels_disabled[trace_count];
+
+ /* a pointer to either `ft_trace_levels_enabled' */
+ /* or `ft_trace_levels_disabled' */
+ int* ft_trace_levels;
/* define array of trace toggle names */
#define FT_TRACE_DEF( x ) #x ,
@@ -140,24 +157,42 @@
}
- /*************************************************************************/
- /* */
- /* Initialize the tracing sub-system. This is done by retrieving the */
- /* value of the `FT2_DEBUG' environment variable. It must be a list of */
- /* toggles, separated by spaces, `;', or `,'. Example: */
- /* */
- /* export FT2_DEBUG="any:3 memory:7 stream:5" */
- /* */
- /* This requests that all levels be set to 3, except the trace level for */
- /* the memory and stream components which are set to 7 and 5, */
- /* respectively. */
- /* */
- /* See the file `include/freetype/internal/fttrace.h' for details of */
- /* the available toggle names. */
- /* */
- /* The level must be between 0 and 7; 0 means quiet (except for serious */
- /* runtime errors), and 7 means _very_ verbose. */
- /* */
+ /* documentation is in ftdebug.h */
+
+ FT_BASE_DEF( void )
+ FT_Trace_Disable( void )
+ {
+ ft_trace_levels = ft_trace_levels_disabled;
+ }
+
+
+ /* documentation is in ftdebug.h */
+
+ FT_BASE_DEF( void )
+ FT_Trace_Enable( void )
+ {
+ ft_trace_levels = ft_trace_levels_enabled;
+ }
+
+
+ /**************************************************************************
+ *
+ * Initialize the tracing sub-system. This is done by retrieving the
+ * value of the `FT2_DEBUG' environment variable. It must be a list of
+ * toggles, separated by spaces, `;', or `,'. Example:
+ *
+ * export FT2_DEBUG="any:3 memory:7 stream:5"
+ *
+ * This requests that all levels be set to 3, except the trace level for
+ * the memory and stream components which are set to 7 and 5,
+ * respectively.
+ *
+ * See the file `include/freetype/internal/fttrace.h' for details of
+ * the available toggle names.
+ *
+ * The level must be between 0 and 7; 0 means quiet (except for serious
+ * runtime errors), and 7 means _very_ verbose.
+ */
FT_BASE_DEF( void )
ft_debug_init( void )
{
@@ -223,14 +258,16 @@
{
/* special case for `any' */
for ( n = 0; n < trace_count; n++ )
- ft_trace_levels[n] = level;
+ ft_trace_levels_enabled[n] = level;
}
else
- ft_trace_levels[found] = level;
+ ft_trace_levels_enabled[found] = level;
}
}
}
}
+
+ ft_trace_levels = ft_trace_levels_enabled;
}
@@ -260,6 +297,22 @@
}
+ FT_BASE_DEF( void )
+ FT_Trace_Disable( void )
+ {
+ /* nothing */
+ }
+
+
+ /* documentation is in ftdebug.h */
+
+ FT_BASE_DEF( void )
+ FT_Trace_Enable( void )
+ {
+ /* nothing */
+ }
+
+
#endif /* !FT_DEBUG_LEVEL_TRACE */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/fterrors.c b/Build/source/libs/freetype2/freetype-src/src/base/fterrors.c
new file mode 100644
index 00000000000..4ef326d8e28
--- /dev/null
+++ b/Build/source/libs/freetype2/freetype-src/src/base/fterrors.c
@@ -0,0 +1,45 @@
+/****************************************************************************
+ *
+ * fterrors.c
+ *
+ * FreeType API for error code handling.
+ *
+ * Copyright (C) 2018-2019 by
+ * Armin Hasitzka, 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 <ft2build.h>
+#include FT_ERRORS_H
+
+
+ /* documentation is in fterrors.h */
+
+ FT_EXPORT_DEF( const char* )
+ FT_Error_String( FT_Error error_code )
+ {
+ if ( error_code < 0 ||
+ error_code >= FT_ERR_CAT( FT_ERR_PREFIX, Max ) )
+ return NULL;
+
+#if defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || \
+ defined( FT_DEBUG_LEVEL_ERROR )
+
+#undef FTERRORS_H_
+#define FT_ERROR_START_LIST switch ( FT_ERROR_BASE( error_code ) ) {
+#define FT_ERRORDEF( e, v, s ) case v: return s;
+#define FT_ERROR_END_LIST }
+
+#include FT_ERRORS_H
+
+#endif /* defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || ... */
+
+ return NULL;
+ }
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftfntfmt.c b/Build/source/libs/freetype2/freetype-src/src/base/ftfntfmt.c
index a2900ceb098..54ba5374164 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftfntfmt.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftfntfmt.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftfntfmt.c */
-/* */
-/* FreeType utility file for font formats (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftfntfmt.c
+ *
+ * FreeType utility file for font formats (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftfstype.c b/Build/source/libs/freetype2/freetype-src/src/base/ftfstype.c
index e6cdf6e2ec6..45e2d8089bf 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftfstype.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftfstype.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftfstype.c */
-/* */
-/* FreeType utility file to access FSType data (body). */
-/* */
-/* Copyright 2008-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftfstype.c
+ *
+ * FreeType utility file to access FSType data (body).
+ *
+ * Copyright (C) 2008-2019 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 <ft2build.h>
#include FT_TYPE1_TABLES_H
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftgasp.c b/Build/source/libs/freetype2/freetype-src/src/base/ftgasp.c
index 4f80bba630c..720fb113ca3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftgasp.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftgasp.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftgasp.c */
-/* */
-/* Access of TrueType's `gasp' table (body). */
-/* */
-/* Copyright 2007-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgasp.c
+ *
+ * Access of TrueType's `gasp' table (body).
+ *
+ * Copyright (C) 2007-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftgloadr.c b/Build/source/libs/freetype2/freetype-src/src/base/ftgloadr.c
index 47202496b9c..bfeed461a83 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftgloadr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftgloadr.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftgloadr.c */
-/* */
-/* The FreeType glyph loader (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgloadr.c
+ *
+ * The FreeType glyph loader (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -23,7 +23,7 @@
#include FT_INTERNAL_OBJECTS_H
#undef FT_COMPONENT
-#define FT_COMPONENT trace_gloader
+#define FT_COMPONENT gloader
/*************************************************************************/
@@ -38,31 +38,31 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* The glyph loader is a simple object which is used to load a set of */
- /* glyphs easily. It is critical for the correct loading of composites. */
- /* */
- /* Ideally, one can see it as a stack of abstract `glyph' objects. */
- /* */
- /* loader.base Is really the bottom of the stack. It describes a */
- /* single glyph image made of the juxtaposition of */
- /* several glyphs (those `in the stack'). */
- /* */
- /* loader.current Describes the top of the stack, on which a new */
- /* glyph can be loaded. */
- /* */
- /* Rewind Clears the stack. */
- /* Prepare Set up `loader.current' for addition of a new glyph */
- /* image. */
- /* Add Add the `current' glyph image to the `base' one, */
- /* and prepare for another one. */
- /* */
- /* The glyph loader is now a base object. Each driver used to */
- /* re-implement it in one way or the other, which wasted code and */
- /* energy. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * The glyph loader is a simple object which is used to load a set of
+ * glyphs easily. It is critical for the correct loading of composites.
+ *
+ * Ideally, one can see it as a stack of abstract `glyph' objects.
+ *
+ * loader.base Is really the bottom of the stack. It describes a
+ * single glyph image made of the juxtaposition of
+ * several glyphs (those `in the stack').
+ *
+ * loader.current Describes the top of the stack, on which a new
+ * glyph can be loaded.
+ *
+ * Rewind Clears the stack.
+ * Prepare Set up `loader.current' for addition of a new glyph
+ * image.
+ * Add Add the `current' glyph image to the `base' one,
+ * and prepare for another one.
+ *
+ * The glyph loader is now a base object. Each driver used to
+ * re-implement it in one way or the other, which wasted code and
+ * energy.
+ *
+ */
/* create a new glyph loader */
@@ -99,12 +99,12 @@
}
- /* reset the glyph loader, frees all allocated tables */
- /* and starts from zero */
+ /* reset glyph loader, free all allocated tables, */
+ /* and start from zero */
FT_BASE_DEF( void )
FT_GlyphLoader_Reset( FT_GlyphLoader loader )
{
- FT_Memory memory = loader->memory;
+ FT_Memory memory = loader->memory;
FT_FREE( loader->base.outline.points );
@@ -129,7 +129,7 @@
{
if ( loader )
{
- FT_Memory memory = loader->memory;
+ FT_Memory memory = loader->memory;
FT_GlyphLoader_Reset( loader );
@@ -361,46 +361,4 @@
}
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
- FT_GlyphLoader source )
- {
- FT_Error error;
- FT_UInt num_points = (FT_UInt)source->base.outline.n_points;
- FT_UInt num_contours = (FT_UInt)source->base.outline.n_contours;
-
-
- error = FT_GlyphLoader_CheckPoints( target, num_points, num_contours );
- if ( !error )
- {
- FT_Outline* out = &target->base.outline;
- FT_Outline* in = &source->base.outline;
-
-
- FT_ARRAY_COPY( out->points, in->points,
- num_points );
- FT_ARRAY_COPY( out->tags, in->tags,
- num_points );
- FT_ARRAY_COPY( out->contours, in->contours,
- num_contours );
-
- /* do we need to copy the extra points? */
- if ( target->use_extra && source->use_extra )
- {
- FT_ARRAY_COPY( target->base.extra_points, source->base.extra_points,
- num_points );
- FT_ARRAY_COPY( target->base.extra_points2, source->base.extra_points2,
- num_points );
- }
-
- out->n_points = (short)num_points;
- out->n_contours = (short)num_contours;
-
- FT_GlyphLoader_Adjust_Points( target );
- }
-
- return error;
- }
-
-
/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftglyph.c b/Build/source/libs/freetype2/freetype-src/src/base/ftglyph.c
index 6759aa25d0e..e6b13279015 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftglyph.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftglyph.c
@@ -1,31 +1,31 @@
-/***************************************************************************/
-/* */
-/* ftglyph.c */
-/* */
-/* FreeType convenience functions to handle glyphs (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This file contains the definition of several convenience functions */
- /* that can be used by client applications to easily retrieve glyph */
- /* bitmaps and outlines from a given face. */
- /* */
- /* These functions should be optional if you are writing a font server */
- /* or text layout engine on top of FreeType. However, they are pretty */
- /* handy for many other simple uses of the library. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftglyph.c
+ *
+ * FreeType convenience functions to handle glyphs (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * This file contains the definition of several convenience functions
+ * that can be used by client applications to easily retrieve glyph
+ * bitmaps and outlines from a given face.
+ *
+ * These functions should be optional if you are writing a font server
+ * or text layout engine on top of FreeType. However, they are pretty
+ * handy for many other simple uses of the library.
+ *
+ */
#include <ft2build.h>
@@ -36,16 +36,15 @@
#include FT_BITMAP_H
#include FT_INTERNAL_OBJECTS_H
-#include "basepic.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_glyph
+#define FT_COMPONENT glyph
/*************************************************************************/
@@ -77,7 +76,7 @@
/* do lazy copying whenever possible */
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
- glyph->bitmap = slot->bitmap;
+ glyph->bitmap = slot->bitmap;
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
else
@@ -359,37 +358,28 @@
/* documentation is in ftglyph.h */
- FT_EXPORT_DEF( FT_Error )
- FT_Get_Glyph( FT_GlyphSlot slot,
- FT_Glyph *aglyph )
+ FT_EXPORT( FT_Error )
+ FT_New_Glyph( FT_Library library,
+ FT_Glyph_Format format,
+ FT_Glyph *aglyph )
{
- FT_Library library;
- FT_Error error;
- FT_Glyph glyph;
-
const FT_Glyph_Class* clazz = NULL;
-
- if ( !slot )
- return FT_THROW( Invalid_Slot_Handle );
-
- library = slot->library;
-
- if ( !aglyph )
+ if ( !library || !aglyph )
return FT_THROW( Invalid_Argument );
/* if it is a bitmap, that's easy :-) */
- if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
- clazz = FT_BITMAP_GLYPH_CLASS_GET;
+ if ( format == FT_GLYPH_FORMAT_BITMAP )
+ clazz = &ft_bitmap_glyph_class;
/* if it is an outline */
- else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
- clazz = FT_OUTLINE_GLYPH_CLASS_GET;
+ else if ( format == FT_GLYPH_FORMAT_OUTLINE )
+ clazz = &ft_outline_glyph_class;
else
{
/* try to find a renderer that supports the glyph image format */
- FT_Renderer render = FT_Lookup_Renderer( library, slot->format, 0 );
+ FT_Renderer render = FT_Lookup_Renderer( library, format, 0 );
if ( render )
@@ -397,13 +387,31 @@
}
if ( !clazz )
- {
- error = FT_THROW( Invalid_Glyph_Format );
- goto Exit;
- }
+ return FT_THROW( Invalid_Glyph_Format );
+
+ /* create FT_Glyph object */
+ return ft_new_glyph( library, clazz, aglyph );
+ }
+
+
+ /* documentation is in ftglyph.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_Glyph( FT_GlyphSlot slot,
+ FT_Glyph *aglyph )
+ {
+ FT_Error error;
+ FT_Glyph glyph;
+
+
+ if ( !slot )
+ return FT_THROW( Invalid_Slot_Handle );
+
+ if ( !aglyph )
+ return FT_THROW( Invalid_Argument );
/* create FT_Glyph object */
- error = ft_new_glyph( library, clazz, &glyph );
+ error = FT_New_Glyph( slot->library, slot->format, &glyph );
if ( error )
goto Exit;
@@ -427,7 +435,7 @@
glyph->advance.y = slot->advance.y * 1024;
/* now import the image from the glyph slot */
- error = clazz->glyph_init( glyph, slot );
+ error = glyph->clazz->glyph_init( glyph, slot );
Exit2:
/* if an error occurred, destroy the glyph */
@@ -505,8 +513,8 @@
{
acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
- acbox->xMax = FT_PIX_CEIL( acbox->xMax );
- acbox->yMax = FT_PIX_CEIL( acbox->yMax );
+ acbox->xMax = FT_PIX_CEIL_LONG( acbox->xMax );
+ acbox->yMax = FT_PIX_CEIL_LONG( acbox->yMax );
}
/* convert to integer pixels if needed */
@@ -536,7 +544,6 @@
FT_BitmapGlyph bitmap = NULL;
const FT_Glyph_Class* clazz;
- /* FT_BITMAP_GLYPH_CLASS_GET dereferences `library' in PIC mode */
FT_Library library;
@@ -553,7 +560,7 @@
goto Bad;
/* when called with a bitmap glyph, do nothing and return successfully */
- if ( clazz == FT_BITMAP_GLYPH_CLASS_GET )
+ if ( clazz == &ft_bitmap_glyph_class )
goto Exit;
if ( !clazz->glyph_prepare )
@@ -569,7 +576,7 @@
dummy.format = clazz->glyph_format;
/* create result bitmap glyph */
- error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET, &b );
+ error = ft_new_glyph( library, &ft_bitmap_glyph_class, &b );
if ( error )
goto Exit;
bitmap = (FT_BitmapGlyph)b;
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftgxval.c b/Build/source/libs/freetype2/freetype-src/src/base/ftgxval.c
index 19e2d6acb5a..0677d26faaa 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftgxval.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftgxval.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* ftgxval.c */
-/* */
-/* FreeType API for validating TrueTypeGX/AAT tables (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* Masatake YAMATO, Redhat K.K, */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgxval.c
+ *
+ * FreeType API for validating TrueTypeGX/AAT tables (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * Masatake YAMATO, Redhat K.K,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/fthash.c b/Build/source/libs/freetype2/freetype-src/src/base/fthash.c
index 21bc8dd5b42..387e6d26db9 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/fthash.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/fthash.c
@@ -1,10 +1,10 @@
-/***************************************************************************/
-/* */
-/* fthash.c */
-/* */
-/* Hashing functions (body). */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * fthash.c
+ *
+ * Hashing functions (body).
+ *
+ */
/*
* Copyright 2000 Computing Research Labs, New Mexico State University
@@ -30,13 +30,13 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
- /*************************************************************************/
- /* */
- /* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
- /* */
- /* taken from Mark Leisher's xmbdfed package */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50
+ *
+ * taken from Mark Leisher's xmbdfed package
+ *
+ */
#include <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftinit.c b/Build/source/libs/freetype2/freetype-src/src/base/ftinit.c
index 1fa4721094a..9d524effa92 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftinit.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftinit.c
@@ -1,40 +1,40 @@
-/***************************************************************************/
-/* */
-/* ftinit.c */
-/* */
-/* FreeType initialization layer (body). */
-/* */
-/* Copyright 1996-2018 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 purpose of this file is to implement the following two */
- /* functions: */
- /* */
- /* FT_Add_Default_Modules(): */
- /* This function is used to add the set of default modules to a */
- /* fresh new library object. The set is taken from the header file */
- /* `freetype/config/ftmodule.h'. See the document `FreeType 2.0 */
- /* Build System' for more information. */
- /* */
- /* FT_Init_FreeType(): */
- /* This function creates a system object for the current platform, */
- /* builds a library out of it, then calls FT_Default_Drivers(). */
- /* */
- /* Note that even if FT_Init_FreeType() uses the implementation of the */
- /* system object defined at build time, client applications are still */
- /* able to provide their own `ftsystem.c'. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftinit.c
+ *
+ * FreeType initialization layer (body).
+ *
+ * Copyright (C) 1996-2019 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 purpose of this file is to implement the following two
+ * functions:
+ *
+ * FT_Add_Default_Modules():
+ * This function is used to add the set of default modules to a
+ * fresh new library object. The set is taken from the header file
+ * `freetype/config/ftmodule.h'. See the document `FreeType 2.0
+ * Build System' for more information.
+ *
+ * FT_Init_FreeType():
+ * This function creates a system object for the current platform,
+ * builds a library out of it, then calls FT_Default_Drivers().
+ *
+ * Note that even if FT_Init_FreeType() uses the implementation of the
+ * system object defined at build time, client applications are still
+ * able to provide their own `ftsystem.c'.
+ *
+ */
#include <ft2build.h>
@@ -42,20 +42,16 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_MODULE_H
-#include "basepic.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_init
-
-
-#ifndef FT_CONFIG_OPTION_PIC
+#define FT_COMPONENT init
#undef FT_USE_MODULE
@@ -78,120 +74,6 @@
};
-#else /* FT_CONFIG_OPTION_PIC */
-
-
-#ifdef __cplusplus
-#define FT_EXTERNC extern "C"
-#else
-#define FT_EXTERNC extern
-#endif
-
- /* declare the module's class creation/destruction functions */
-#undef FT_USE_MODULE
-#define FT_USE_MODULE( type, x ) \
- FT_EXTERNC FT_Error \
- FT_Create_Class_ ## x( FT_Library library, \
- FT_Module_Class* *output_class ); \
- FT_EXTERNC void \
- FT_Destroy_Class_ ## x( FT_Library library, \
- FT_Module_Class* clazz );
-
-#include FT_CONFIG_MODULES_H
-
- /* count all module classes */
-#undef FT_USE_MODULE
-#define FT_USE_MODULE( type, x ) MODULE_CLASS_ ## x,
-
- enum
- {
-#include FT_CONFIG_MODULES_H
- FT_NUM_MODULE_CLASSES
- };
-
- /* destroy all module classes */
-#undef FT_USE_MODULE
-#define FT_USE_MODULE( type, x ) \
- if ( classes[i] ) \
- { \
- FT_Destroy_Class_ ## x( library, classes[i] ); \
- } \
- i++;
-
-
- FT_BASE_DEF( void )
- ft_destroy_default_module_classes( FT_Library library )
- {
- FT_Module_Class* *classes;
- FT_Memory memory;
- FT_UInt i;
- BasePIC* pic_container = (BasePIC*)library->pic_container.base;
-
-
- if ( !pic_container->default_module_classes )
- return;
-
- memory = library->memory;
- classes = pic_container->default_module_classes;
- i = 0;
-
-#include FT_CONFIG_MODULES_H
-
- FT_FREE( classes );
- pic_container->default_module_classes = NULL;
- }
-
-
- /* initialize all module classes and the pointer table */
-#undef FT_USE_MODULE
-#define FT_USE_MODULE( type, x ) \
- error = FT_Create_Class_ ## x( library, &clazz ); \
- if ( error ) \
- goto Exit; \
- classes[i++] = clazz;
-
-
- FT_BASE_DEF( FT_Error )
- ft_create_default_module_classes( FT_Library library )
- {
- FT_Error error;
- FT_Memory memory;
- FT_Module_Class* *classes = NULL;
- FT_Module_Class* clazz;
- FT_UInt i;
- BasePIC* pic_container = (BasePIC*)library->pic_container.base;
-
-
- memory = library->memory;
-
- pic_container->default_module_classes = NULL;
-
- if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) *
- ( FT_NUM_MODULE_CLASSES + 1 ) ) )
- return error;
-
- /* initialize all pointers to 0, especially the last one */
- for ( i = 0; i < FT_NUM_MODULE_CLASSES; i++ )
- classes[i] = NULL;
- classes[FT_NUM_MODULE_CLASSES] = NULL;
-
- i = 0;
-
-#include FT_CONFIG_MODULES_H
-
- Exit:
- if ( error )
- ft_destroy_default_module_classes( library );
- else
- pic_container->default_module_classes = classes;
-
- return error;
- }
-
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
/* documentation is in ftmodapi.h */
FT_EXPORT_DEF( void )
@@ -201,16 +83,10 @@
const FT_Module_Class* const* cur;
- /* FT_DEFAULT_MODULES_GET dereferences `library' in PIC mode */
-#ifdef FT_CONFIG_OPTION_PIC
- if ( !library )
- return;
-#endif
-
/* GCC 4.6 warns the type difference:
* FT_Module_Class** != const FT_Module_Class* const*
*/
- cur = (const FT_Module_Class* const*)FT_DEFAULT_MODULES_GET;
+ cur = (const FT_Module_Class* const*)ft_default_modules;
/* test for valid `library' delayed to FT_Add_Module() */
while ( *cur )
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c b/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
index 8d314df0803..9fb49ba116e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftlcdfil.c */
-/* */
-/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftlcdfil.c
+ *
+ * FreeType API for color filtering of subpixel bitmap glyphs (body).
+ *
+ * Copyright (C) 2006-2019 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 <ft2build.h>
@@ -34,9 +34,9 @@
/* add padding according to filter weights */
FT_BASE_DEF (void)
- ft_lcd_padding( FT_Pos* Min,
- FT_Pos* Max,
- FT_GlyphSlot slot )
+ ft_lcd_padding( FT_BBox* cbox,
+ FT_GlyphSlot slot,
+ FT_Render_Mode mode )
{
FT_Byte* lcd_weights;
FT_Bitmap_LcdFilterFunc lcd_filter_func;
@@ -56,10 +56,20 @@
if ( lcd_filter_func == ft_lcd_filter_fir )
{
- *Min -= lcd_weights[0] ? 43 :
- lcd_weights[1] ? 22 : 0;
- *Max += lcd_weights[4] ? 43 :
- lcd_weights[3] ? 22 : 0;
+ if ( mode == FT_RENDER_MODE_LCD )
+ {
+ cbox->xMin -= lcd_weights[0] ? 43 :
+ lcd_weights[1] ? 22 : 0;
+ cbox->xMax += lcd_weights[4] ? 43 :
+ lcd_weights[3] ? 22 : 0;
+ }
+ else if ( mode == FT_RENDER_MODE_LCD_V )
+ {
+ cbox->yMin -= lcd_weights[0] ? 43 :
+ lcd_weights[1] ? 22 : 0;
+ cbox->yMax += lcd_weights[4] ? 43 :
+ lcd_weights[3] ? 22 : 0;
+ }
}
}
@@ -275,6 +285,8 @@
#endif /* USE_LEGACY */
+ /* documentation in ftlcdfil.h */
+
FT_EXPORT_DEF( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights )
@@ -292,6 +304,8 @@
}
+ /* documentation in ftlcdfil.h */
+
FT_EXPORT_DEF( FT_Error )
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter )
@@ -341,18 +355,41 @@
return FT_Err_Ok;
}
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Library_SetLcdGeometry( FT_Library library,
+ FT_Vector* sub )
+ {
+ FT_UNUSED( library );
+ FT_UNUSED( sub );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
- /* add padding according to accommodate outline shifts */
+ /* add padding to accommodate outline shifts */
FT_BASE_DEF (void)
- ft_lcd_padding( FT_Pos* Min,
- FT_Pos* Max,
- FT_GlyphSlot slot )
+ ft_lcd_padding( FT_BBox* cbox,
+ FT_GlyphSlot slot,
+ FT_Render_Mode mode )
{
- FT_UNUSED( slot );
+ FT_Vector* sub = slot->library->lcd_geometry;
- *Min -= 21;
- *Max += 21;
+ if ( mode == FT_RENDER_MODE_LCD )
+ {
+ cbox->xMin -= FT_MAX( FT_MAX( sub[0].x, sub[1].x ), sub[2].x );
+ cbox->xMax -= FT_MIN( FT_MIN( sub[0].x, sub[1].x ), sub[2].x );
+ cbox->yMin -= FT_MAX( FT_MAX( sub[0].y, sub[1].y ), sub[2].y );
+ cbox->yMax -= FT_MIN( FT_MIN( sub[0].y, sub[1].y ), sub[2].y );
+ }
+ else if ( mode == FT_RENDER_MODE_LCD_V )
+ {
+ cbox->xMin -= FT_MAX( FT_MAX( sub[0].y, sub[1].y ), sub[2].y );
+ cbox->xMax -= FT_MIN( FT_MIN( sub[0].y, sub[1].y ), sub[2].y );
+ cbox->yMin += FT_MIN( FT_MIN( sub[0].x, sub[1].x ), sub[2].x );
+ cbox->yMax += FT_MAX( FT_MAX( sub[0].x, sub[1].x ), sub[2].x );
+ }
}
@@ -377,6 +414,24 @@
return FT_THROW( Unimplemented_Feature );
}
+
+ /* documentation in ftlcdfil.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Library_SetLcdGeometry( FT_Library library,
+ FT_Vector sub[3] )
+ {
+ if ( !library )
+ return FT_THROW( Invalid_Library_Handle );
+
+ if ( !sub )
+ return FT_THROW( Invalid_Argument );
+
+ ft_memcpy( library->lcd_geometry, sub, 3 * sizeof( FT_Vector ) );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftmac.c b/Build/source/libs/freetype2/freetype-src/src/base/ftmac.c
index fd4c0cc274f..5f23ceea9f3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftmac.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftmac.c
@@ -1,23 +1,23 @@
-/***************************************************************************/
-/* */
-/* ftmac.c */
-/* */
-/* Mac FOND support. Written by just@letterror.com. */
-/* Heavily modified by mpsuzuki, George Williams, and Sean McBride. */
-/* */
-/* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
-/* classic platforms built by MPW. */
-/* */
-/* Copyright 1996-2018 by */
-/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftmac.c
+ *
+ * Mac FOND support. Written by just@letterror.com.
+ * Heavily modified by mpsuzuki, George Williams, and Sean McBride.
+ *
+ * This file is for Mac OS X only; see builds/mac/ftoldmac.c for
+ * classic platforms built by MPW.
+ *
+ * Copyright (C) 1996-2019 by
+ * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
/*
@@ -954,17 +954,17 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face */
- /* */
- /* <Description> */
- /* This is the Mac-specific implementation of FT_New_Face. In */
- /* addition to the standard FT_New_Face() functionality, it also */
- /* accepts pathnames to Mac suitcase files. For further */
- /* documentation see the original FT_New_Face() in freetype.h. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * FT_New_Face
+ *
+ * @Description:
+ * This is the Mac-specific implementation of FT_New_Face. In
+ * addition to the standard FT_New_Face() functionality, it also
+ * accepts pathnames to Mac suitcase files. For further
+ * documentation see the original FT_New_Face() in freetype.h.
+ */
FT_EXPORT_DEF( FT_Error )
FT_New_Face( FT_Library library,
const char* pathname,
@@ -995,17 +995,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FSRef */
- /* */
- /* <Description> */
- /* FT_New_Face_From_FSRef is identical to FT_New_Face except it */
- /* accepts an FSRef instead of a path. */
- /* */
- /* This function is deprecated because Carbon data types (FSRef) */
- /* are not cross-platform, and thus not suitable for the FreeType API. */
+ /**************************************************************************
+ *
+ * @Function:
+ * FT_New_Face_From_FSRef
+ *
+ * @Description:
+ * FT_New_Face_From_FSRef is identical to FT_New_Face except it
+ * accepts an FSRef instead of a path.
+ *
+ * This function is deprecated because Carbon data types (FSRef)
+ * are not cross-platform, and thus not suitable for the FreeType API.
+ */
FT_EXPORT_DEF( FT_Error )
FT_New_Face_From_FSRef( FT_Library library,
const FSRef* ref,
@@ -1040,16 +1041,17 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FSSpec */
- /* */
- /* <Description> */
- /* FT_New_Face_From_FSSpec is identical to FT_New_Face except it */
- /* accepts an FSSpec instead of a path. */
- /* */
- /* This function is deprecated because FSSpec is deprecated in Mac OS X */
+ /**************************************************************************
+ *
+ * @Function:
+ * FT_New_Face_From_FSSpec
+ *
+ * @Description:
+ * FT_New_Face_From_FSSpec is identical to FT_New_Face except it
+ * accepts an FSSpec instead of a path.
+ *
+ * This function is deprecated because FSSpec is deprecated in Mac OS X
+ */
FT_EXPORT_DEF( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec* spec,
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftmm.c b/Build/source/libs/freetype2/freetype-src/src/base/ftmm.c
index 800441bcac8..ba9e67f008a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftmm.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftmm.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftmm.c */
-/* */
-/* Multiple Master font support (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftmm.c
+ *
+ * Multiple Master font support (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -25,14 +25,14 @@
#include FT_SERVICE_METRICS_VARIATIONS_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_mm
+#define FT_COMPONENT mm
static FT_Error
@@ -202,6 +202,67 @@
/* documentation is in ftmm.h */
FT_EXPORT_DEF( FT_Error )
+ FT_Set_MM_WeightVector( FT_Face face,
+ FT_UInt len,
+ FT_Fixed* weightvector )
+ {
+ FT_Error error;
+ FT_Service_MultiMasters service;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ if ( len && !weightvector )
+ return FT_THROW( Invalid_Argument );
+
+ error = ft_face_get_mm_service( face, &service );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service->set_mm_weightvector )
+ error = service->set_mm_weightvector( face, len, weightvector );
+ }
+
+ /* enforce recomputation of auto-hinting data */
+ if ( !error && face->autohint.finalizer )
+ {
+ face->autohint.finalizer( face->autohint.data );
+ face->autohint.data = NULL;
+ }
+
+ return error;
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_MM_WeightVector( FT_Face face,
+ FT_UInt* len,
+ FT_Fixed* weightvector )
+ {
+ FT_Error error;
+ FT_Service_MultiMasters service;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ if ( len && !weightvector )
+ return FT_THROW( Invalid_Argument );
+
+ error = ft_face_get_mm_service( face, &service );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service->get_mm_weightvector )
+ error = service->get_mm_weightvector( face, len, weightvector );
+ }
+
+ return error;
+ }
+
+
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c b/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
index 8d07e35ae37..3f8619d3b3c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftobjs.c */
-/* */
-/* The FreeType private base classes (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftobjs.c
+ *
+ * The FreeType private base classes (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -79,6 +79,18 @@
#pragma warning( pop )
#endif
+ static const char* const pixel_modes[] =
+ {
+ "none",
+ "monochrome bitmap",
+ "gray 8-bit bitmap",
+ "gray 2-bit bitmap",
+ "gray 4-bit bitmap",
+ "LCD 8-bit bitmap",
+ "vertical LCD 8-bit bitmap",
+ "BGRA 32-bit color image bitmap"
+ };
+
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -259,14 +271,14 @@
}
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_objs
+#define FT_COMPONENT objs
/*************************************************************************/
@@ -330,7 +342,9 @@
}
- FT_BASE_DEF( void )
+ /* overflow-resistant presetting of bitmap position and dimensions; */
+ /* also check whether the size is too large for rendering */
+ FT_BASE_DEF( FT_Bool )
ft_glyphslot_preset_bitmap( FT_GlyphSlot slot,
FT_Render_Mode mode,
const FT_Vector* origin )
@@ -340,15 +354,15 @@
FT_Pixel_Mode pixel_mode;
- FT_BBox cbox;
+ FT_BBox cbox, pbox;
FT_Pos x_shift = 0;
FT_Pos y_shift = 0;
FT_Pos x_left, y_top;
FT_Pos width, height, pitch;
- if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
- return;
+ if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
+ return 1;
if ( origin )
{
@@ -360,76 +374,89 @@
/* taking into account the origin shift */
FT_Outline_Get_CBox( outline, &cbox );
- cbox.xMin += x_shift;
- cbox.yMin += y_shift;
- cbox.xMax += x_shift;
- cbox.yMax += y_shift;
+ /* rough estimate of pixel box */
+ pbox.xMin = ( cbox.xMin >> 6 ) + ( x_shift >> 6 );
+ pbox.yMin = ( cbox.yMin >> 6 ) + ( y_shift >> 6 );
+ pbox.xMax = ( cbox.xMax >> 6 ) + ( x_shift >> 6 );
+ pbox.yMax = ( cbox.yMax >> 6 ) + ( y_shift >> 6 );
+
+ /* tiny remainder box */
+ cbox.xMin = ( cbox.xMin & 63 ) + ( x_shift & 63 );
+ cbox.yMin = ( cbox.yMin & 63 ) + ( y_shift & 63 );
+ cbox.xMax = ( cbox.xMax & 63 ) + ( x_shift & 63 );
+ cbox.yMax = ( cbox.yMax & 63 ) + ( y_shift & 63 );
switch ( mode )
{
case FT_RENDER_MODE_MONO:
pixel_mode = FT_PIXEL_MODE_MONO;
#if 1
- /* undocumented but confirmed: bbox values get rounded */
- /* unless the rounded box can collapse for a narrow glyph */
- if ( cbox.xMax - cbox.xMin < 64 )
- {
- cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
- cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
- }
- else
- {
- cbox.xMin = FT_PIX_ROUND_LONG( cbox.xMin );
- cbox.xMax = FT_PIX_ROUND_LONG( cbox.xMax );
- }
+ /* x */
+
+ /* undocumented but confirmed: bbox values get rounded; */
+ /* we do asymmetric rounding so that the center of a pixel */
+ /* gets always included */
+
+ pbox.xMin += ( cbox.xMin + 31 ) >> 6;
+ pbox.xMax += ( cbox.xMax + 32 ) >> 6;
- if ( cbox.yMax - cbox.yMin < 64 )
+ /* if the bbox collapsed, we add a pixel based on the total */
+ /* rounding remainder to cover most of the original cbox */
+
+ if ( pbox.xMin == pbox.xMax )
{
- cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
- cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
+ if ( ( ( cbox.xMin + 31 ) & 63 ) - 31 +
+ ( ( cbox.xMax + 32 ) & 63 ) - 32 < 0 )
+ pbox.xMin -= 1;
+ else
+ pbox.xMax += 1;
}
- else
+
+ /* y */
+
+ pbox.yMin += ( cbox.yMin + 31 ) >> 6;
+ pbox.yMax += ( cbox.yMax + 32 ) >> 6;
+
+ if ( pbox.yMin == pbox.yMax )
{
- cbox.yMin = FT_PIX_ROUND_LONG( cbox.yMin );
- cbox.yMax = FT_PIX_ROUND_LONG( cbox.yMax );
+ if ( ( ( cbox.yMin + 31 ) & 63 ) - 31 +
+ ( ( cbox.yMax + 32 ) & 63 ) - 32 < 0 )
+ pbox.yMin -= 1;
+ else
+ pbox.yMax += 1;
}
+
+ break;
#else
- cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
- cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
- cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
- cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
+ goto Adjust;
#endif
- break;
case FT_RENDER_MODE_LCD:
pixel_mode = FT_PIXEL_MODE_LCD;
- ft_lcd_padding( &cbox.xMin, &cbox.xMax, slot );
- goto Round;
+ ft_lcd_padding( &cbox, slot, mode );
+ goto Adjust;
case FT_RENDER_MODE_LCD_V:
pixel_mode = FT_PIXEL_MODE_LCD_V;
- ft_lcd_padding( &cbox.yMin, &cbox.yMax, slot );
- goto Round;
+ ft_lcd_padding( &cbox, slot, mode );
+ goto Adjust;
case FT_RENDER_MODE_NORMAL:
case FT_RENDER_MODE_LIGHT:
default:
pixel_mode = FT_PIXEL_MODE_GRAY;
- Round:
- cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
- cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
- cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
- cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
+ Adjust:
+ pbox.xMin += cbox.xMin >> 6;
+ pbox.yMin += cbox.yMin >> 6;
+ pbox.xMax += ( cbox.xMax + 63 ) >> 6;
+ pbox.yMax += ( cbox.yMax + 63 ) >> 6;
}
- x_shift = SUB_LONG( x_shift, cbox.xMin );
- y_shift = SUB_LONG( y_shift, cbox.yMin );
+ x_left = pbox.xMin;
+ y_top = pbox.yMax;
- x_left = cbox.xMin >> 6;
- y_top = cbox.yMax >> 6;
-
- width = ( (FT_ULong)cbox.xMax - (FT_ULong)cbox.xMin ) >> 6;
- height = ( (FT_ULong)cbox.yMax - (FT_ULong)cbox.yMin ) >> 6;
+ width = pbox.xMax - pbox.xMin;
+ height = pbox.yMax - pbox.yMin;
switch ( pixel_mode )
{
@@ -459,6 +486,16 @@
bitmap->width = (unsigned int)width;
bitmap->rows = (unsigned int)height;
bitmap->pitch = pitch;
+
+ if ( pbox.xMin < -0x8000 || pbox.xMax > 0x7FFF ||
+ pbox.yMin < -0x8000 || pbox.yMax > 0x7FFF )
+ {
+ FT_TRACE3(( "ft_glyphslot_preset_bitmap: [%ld %ld %ld %ld]\n",
+ pbox.xMin, pbox.yMin, pbox.xMax, pbox.yMax ));
+ return 1;
+ }
+
+ return 0;
}
@@ -807,7 +844,7 @@
* - Do only auto-hinting if we have
*
* - a hinter module,
- * - a scalable font format dealing with outlines,
+ * - a scalable font,
* - not a tricky font, and
* - no transforms except simple slants and/or rotations by
* integer multiples of 90 degrees.
@@ -825,8 +862,7 @@
if ( hinter &&
!( load_flags & FT_LOAD_NO_HINTING ) &&
!( load_flags & FT_LOAD_NO_AUTOHINT ) &&
- FT_DRIVER_IS_SCALABLE( driver ) &&
- FT_DRIVER_USES_OUTLINES( driver ) &&
+ FT_IS_SCALABLE( face ) &&
!FT_IS_TRICKY( face ) &&
( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) ||
( face->internal->transform_matrix.yx == 0 &&
@@ -846,7 +882,7 @@
/* only the new Adobe engine (for both CFF and Type 1) is `light'; */
/* we use `strstr' to catch both `Type 1' and `CID Type 1' */
is_light_type1 =
- ft_strstr( FT_Get_Font_Format( face ), "Type 1" ) != NULL &&
+ ft_strstr( FT_Get_Font_Format( face ), "Type 1" ) != NULL &&
((PS_Driver)driver)->hinting_engine == FT_HINTING_ADOBE;
/* the check for `num_locations' assures that we actually */
@@ -926,8 +962,9 @@
#ifdef GRID_FIT_METRICS
if ( !( load_flags & FT_LOAD_NO_HINTING ) )
- ft_glyphslot_grid_fit_metrics( slot,
- FT_BOOL( load_flags & FT_LOAD_VERTICAL_LAYOUT ) );
+ ft_glyphslot_grid_fit_metrics(
+ slot,
+ FT_BOOL( load_flags & FT_LOAD_VERTICAL_LAYOUT ) );
#endif
}
}
@@ -995,6 +1032,9 @@
}
}
+ slot->glyph_index = glyph_index;
+ slot->internal->load_flags = load_flags;
+
/* do we need to render the image or preset the bitmap now? */
if ( !error &&
( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
@@ -1014,17 +1054,21 @@
ft_glyphslot_preset_bitmap( slot, mode, NULL );
}
- FT_TRACE5(( "FT_Load_Glyph: index %d, flags %x\n",
- glyph_index, load_flags ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE5(( "FT_Load_Glyph: index %d, flags 0x%x\n",
+ glyph_index, load_flags ));
FT_TRACE5(( " x advance: %f\n", slot->advance.x / 64.0 ));
FT_TRACE5(( " y advance: %f\n", slot->advance.y / 64.0 ));
FT_TRACE5(( " linear x advance: %f\n",
slot->linearHoriAdvance / 65536.0 ));
FT_TRACE5(( " linear y advance: %f\n",
slot->linearVertAdvance / 65536.0 ));
- FT_TRACE5(( " bitmap %dx%d, mode %d\n",
- slot->bitmap.width, slot->bitmap.rows,
- slot->bitmap.pixel_mode ));
+ FT_TRACE5(( " bitmap %dx%d, %s (mode %d)\n",
+ slot->bitmap.width,
+ slot->bitmap.rows,
+ pixel_modes[slot->bitmap.pixel_mode],
+ slot->bitmap.pixel_mode ));
+#endif
Exit:
return error;
@@ -1162,20 +1206,20 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* find_unicode_charmap */
- /* */
- /* <Description> */
- /* This function finds a Unicode charmap, if there is one. */
- /* And if there is more than one, it tries to favour the more */
- /* extensive one, i.e., one that supports UCS-4 against those which */
- /* are limited to the BMP (said UCS-2 encoding.) */
- /* */
- /* This function is called from open_face() (just below), and also */
- /* from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ). */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * find_unicode_charmap
+ *
+ * @Description:
+ * This function finds a Unicode charmap, if there is one.
+ * And if there is more than one, it tries to favour the more
+ * extensive one, i.e., one that supports UCS-4 against those which
+ * are limited to the BMP (said UCS-2 encoding.)
+ *
+ * This function is called from open_face() (just below), and also
+ * from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ).
+ */
static FT_Error
find_unicode_charmap( FT_Face face )
{
@@ -1192,26 +1236,26 @@
return FT_THROW( Invalid_CharMap_Handle );
/*
- * The original TrueType specification(s) only specified charmap
- * formats that are capable of mapping 8 or 16 bit character codes to
- * glyph indices.
+ * The original TrueType specification(s) only specified charmap
+ * formats that are capable of mapping 8 or 16 bit character codes to
+ * glyph indices.
*
- * However, recent updates to the Apple and OpenType specifications
- * introduced new formats that are capable of mapping 32-bit character
- * codes as well. And these are already used on some fonts, mainly to
- * map non-BMP Asian ideographs as defined in Unicode.
+ * However, recent updates to the Apple and OpenType specifications
+ * introduced new formats that are capable of mapping 32-bit character
+ * codes as well. And these are already used on some fonts, mainly to
+ * map non-BMP Asian ideographs as defined in Unicode.
*
- * For compatibility purposes, these fonts generally come with
- * *several* Unicode charmaps:
+ * For compatibility purposes, these fonts generally come with
+ * *several* Unicode charmaps:
*
- * - One of them in the "old" 16-bit format, that cannot access
- * all glyphs in the font.
+ * - One of them in the "old" 16-bit format, that cannot access
+ * all glyphs in the font.
*
- * - Another one in the "new" 32-bit format, that can access all
- * the glyphs.
+ * - Another one in the "new" 32-bit format, that can access all
+ * the glyphs.
*
- * This function has been written to always favor a 32-bit charmap
- * when found. Otherwise, a 16-bit one is returned when found.
+ * This function has been written to always favor a 32-bit charmap
+ * when found. Otherwise, a 16-bit one is returned when found.
*/
/* Since the `interesting' table, with IDs (3,10), is normally the */
@@ -1255,15 +1299,15 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* find_variant_selector_charmap */
- /* */
- /* <Description> */
- /* This function finds the variant selector charmap, if there is one. */
- /* There can only be one (platform=0, specific=5, format=14). */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * find_variant_selector_charmap
+ *
+ * @Description:
+ * This function finds the variant selector charmap, if there is one.
+ * There can only be one (platform=0, specific=5, format=14).
+ */
static FT_CharMap
find_variant_selector_charmap( FT_Face face )
{
@@ -1294,14 +1338,14 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* open_face */
- /* */
- /* <Description> */
- /* This function does some work for FT_Open_Face(). */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * open_face
+ *
+ * @Description:
+ * This function does some work for FT_Open_Face().
+ */
static FT_Error
open_face( FT_Driver driver,
FT_Stream *astream,
@@ -2176,13 +2220,13 @@
{
#undef FT_COMPONENT
-#define FT_COMPONENT trace_raccess
+#define FT_COMPONENT raccess
FT_Memory memory = library->memory;
FT_Error error = FT_ERR( Unknown_File_Format );
FT_UInt i;
- char * file_names[FT_RACCESS_N_RULES];
+ char* file_names[FT_RACCESS_N_RULES];
FT_Long offsets[FT_RACCESS_N_RULES];
FT_Error errors[FT_RACCESS_N_RULES];
FT_Bool is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */
@@ -2254,7 +2298,7 @@
return error;
#undef FT_COMPONENT
-#define FT_COMPONENT trace_objs
+#define FT_COMPONENT objs
}
@@ -2282,7 +2326,7 @@
{
#undef FT_COMPONENT
-#define FT_COMPONENT trace_raccess
+#define FT_COMPONENT raccess
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE3(( "Try as dfont: " ));
@@ -2295,7 +2339,7 @@
FT_TRACE3(( "%s\n", error ? "failed" : "successful" ));
#undef FT_COMPONENT
-#define FT_COMPONENT trace_objs
+#define FT_COMPONENT objs
}
@@ -2693,8 +2737,8 @@
/* close the attached stream */
FT_Stream_Free( stream,
- (FT_Bool)( parameters->stream &&
- ( parameters->flags & FT_OPEN_STREAM ) ) );
+ FT_BOOL( parameters->stream &&
+ ( parameters->flags & FT_OPEN_STREAM ) ) );
Exit:
return error;
@@ -3464,7 +3508,8 @@
if ( !face )
return FT_THROW( Invalid_Face_Handle );
- if ( encoding == FT_ENCODING_NONE )
+ /* FT_ENCODING_NONE is a valid encoding for BDF, PCF, and Windows FNT */
+ if ( encoding == FT_ENCODING_NONE && !face->num_charmaps )
return FT_THROW( Invalid_Argument );
/* FT_ENCODING_UNICODE is special. We try to find the `best' Unicode */
@@ -3485,7 +3530,7 @@
if ( cur[0]->encoding == encoding )
{
face->charmap = cur[0];
- return 0;
+ return FT_Err_Ok;
}
}
@@ -3510,14 +3555,12 @@
if ( !cur || !charmap )
return FT_THROW( Invalid_CharMap_Handle );
- if ( FT_Get_CMap_Format( charmap ) == 14 )
- return FT_THROW( Invalid_Argument );
-
limit = cur + face->num_charmaps;
for ( ; cur < limit; cur++ )
{
- if ( cur[0] == charmap )
+ if ( cur[0] == charmap &&
+ FT_Get_CMap_Format ( charmap ) != 14 )
{
face->charmap = cur[0];
return FT_Err_Ok;
@@ -4487,16 +4530,89 @@
FT_Render_Mode render_mode )
{
FT_Error error = FT_Err_Ok;
+ FT_Face face = slot->face;
FT_Renderer renderer;
- /* if it is already a bitmap, no need to do anything */
switch ( slot->format )
{
case FT_GLYPH_FORMAT_BITMAP: /* already a bitmap, don't do anything */
break;
default:
+ if ( slot->internal->load_flags & FT_LOAD_COLOR )
+ {
+ FT_LayerIterator iterator;
+
+ FT_UInt base_glyph = slot->glyph_index;
+
+ FT_Bool have_layers;
+ FT_UInt glyph_index;
+ FT_UInt color_index;
+
+
+ /* check whether we have colored glyph layers */
+ iterator.p = NULL;
+ have_layers = FT_Get_Color_Glyph_Layer( face,
+ base_glyph,
+ &glyph_index,
+ &color_index,
+ &iterator );
+ if ( have_layers )
+ {
+ error = FT_New_GlyphSlot( face, NULL );
+ if ( !error )
+ {
+ TT_Face ttface = (TT_Face)face;
+ SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
+
+
+ do
+ {
+ FT_Int32 load_flags = slot->internal->load_flags;
+
+
+ /* disable the `FT_LOAD_COLOR' flag to avoid recursion */
+ /* right here in this function */
+ load_flags &= ~FT_LOAD_COLOR;
+
+ /* render into the new `face->glyph' glyph slot */
+ load_flags |= FT_LOAD_RENDER;
+
+ error = FT_Load_Glyph( face, glyph_index, load_flags );
+ if ( error )
+ break;
+
+ /* blend new `face->glyph' into old `slot'; */
+ /* at the first call, `slot' is still empty */
+ error = sfnt->colr_blend( ttface,
+ color_index,
+ slot,
+ face->glyph );
+ if ( error )
+ break;
+
+ } while ( FT_Get_Color_Glyph_Layer( face,
+ base_glyph,
+ &glyph_index,
+ &color_index,
+ &iterator ) );
+
+ if ( !error )
+ slot->format = FT_GLYPH_FORMAT_BITMAP;
+
+ /* this call also restores `slot' as the glyph slot */
+ FT_Done_GlyphSlot( face->glyph );
+ }
+
+ if ( !error )
+ return error;
+
+ /* Failed to do the colored layer. Draw outline instead. */
+ slot->format = FT_GLYPH_FORMAT_OUTLINE;
+ }
+ }
+
{
FT_ListNode node = NULL;
@@ -4532,7 +4648,7 @@
#ifdef FT_DEBUG_LEVEL_TRACE
#undef FT_COMPONENT
-#define FT_COMPONENT trace_bitmap
+#define FT_COMPONENT checksum
/*
* Computing the MD5 checksum is expensive, unnecessarily distorting a
@@ -4542,9 +4658,9 @@
*/
/* we use FT_TRACE3 in this block */
- if ( !error &&
- ft_trace_levels[trace_bitmap] >= 3 &&
- slot->bitmap.buffer )
+ if ( !error &&
+ ft_trace_levels[trace_checksum] >= 3 &&
+ slot->bitmap.buffer )
{
FT_Bitmap bitmap;
FT_Error err;
@@ -4565,8 +4681,11 @@
int pitch = bitmap.pitch;
- FT_TRACE3(( "FT_Render_Glyph: bitmap %dx%d, mode %d\n",
- rows, pitch, slot->bitmap.pixel_mode ));
+ FT_TRACE3(( "FT_Render_Glyph: bitmap %dx%d, %s (mode %d)\n",
+ pitch,
+ rows,
+ pixel_modes[slot->bitmap.pixel_mode],
+ slot->bitmap.pixel_mode ));
for ( i = 0; i < rows; i++ )
for ( j = 0; j < pitch; j++ )
@@ -4594,49 +4713,56 @@
*/
/* we use FT_TRACE7 in this block */
- if ( !error &&
- ft_trace_levels[trace_bitmap] >= 7 &&
- slot->bitmap.rows < 128U &&
- slot->bitmap.width < 128U &&
- slot->bitmap.buffer )
+ if ( !error &&
+ ft_trace_levels[trace_checksum] >= 7 )
{
- int rows = (int)slot->bitmap.rows;
- int width = (int)slot->bitmap.width;
- int pitch = slot->bitmap.pitch;
- int i, j, m;
- unsigned char* topleft = slot->bitmap.buffer;
+ if ( slot->bitmap.rows < 128U &&
+ slot->bitmap.width < 128U &&
+ slot->bitmap.buffer )
+ {
+ int rows = (int)slot->bitmap.rows;
+ int width = (int)slot->bitmap.width;
+ int pitch = slot->bitmap.pitch;
+ int i, j, m;
- if ( pitch < 0 )
- topleft -= pitch * ( rows - 1 );
+ unsigned char* topleft = slot->bitmap.buffer;
- FT_TRACE7(( "Netpbm image: start\n" ));
- switch ( slot->bitmap.pixel_mode )
- {
- case FT_PIXEL_MODE_MONO:
- FT_TRACE7(( "P1 %d %d\n", width, rows ));
- for ( i = 0; i < rows; i++ )
- {
- for ( j = 0; j < width; )
- for ( m = 128; m > 0 && j < width; m >>= 1, j++ )
- FT_TRACE7(( " %d", ( topleft[i * pitch + j / 8] & m ) != 0 ));
- FT_TRACE7(( "\n" ));
- }
- break;
- default:
- FT_TRACE7(( "P2 %d %d 255\n", width, rows ));
- for ( i = 0; i < rows; i++ )
+ if ( pitch < 0 )
+ topleft -= pitch * ( rows - 1 );
+
+ FT_TRACE7(( "Netpbm image: start\n" ));
+ switch ( slot->bitmap.pixel_mode )
{
- for ( j = 0; j < width; j += 1 )
- FT_TRACE7(( " %3u", topleft[i * pitch + j] ));
- FT_TRACE7(( "\n" ));
+ case FT_PIXEL_MODE_MONO:
+ FT_TRACE7(( "P1 %d %d\n", width, rows ));
+ for ( i = 0; i < rows; i++ )
+ {
+ for ( j = 0; j < width; )
+ for ( m = 128; m > 0 && j < width; m >>= 1, j++ )
+ FT_TRACE7(( " %d",
+ ( topleft[i * pitch + j / 8] & m ) != 0 ));
+ FT_TRACE7(( "\n" ));
+ }
+ break;
+
+ default:
+ FT_TRACE7(( "P2 %d %d 255\n", width, rows ));
+ for ( i = 0; i < rows; i++ )
+ {
+ for ( j = 0; j < width; j += 1 )
+ FT_TRACE7(( " %3u", topleft[i * pitch + j] ));
+ FT_TRACE7(( "\n" ));
+ }
}
+ FT_TRACE7(( "Netpbm image: end\n" ));
}
- FT_TRACE7(( "Netpbm image: end\n" ));
+ else
+ FT_TRACE7(( "Netpbm image: too large, omitted\n" ));
}
#undef FT_COMPONENT
-#define FT_COMPONENT trace_objs
+#define FT_COMPONENT objs
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -4675,21 +4801,22 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Destroy_Module */
- /* */
- /* <Description> */
- /* Destroys a given module object. For drivers, this also destroys */
- /* all child faces. */
- /* */
- /* <InOut> */
- /* module :: A handle to the target driver object. */
- /* */
- /* <Note> */
- /* The driver _must_ be LOCKED! */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Destroy_Module
+ *
+ * @Description:
+ * Destroys a given module object. For drivers, this also destroys
+ * all child faces.
+ *
+ * @InOut:
+ * module ::
+ * A handle to the target driver object.
+ *
+ * @Note:
+ * The driver _must_ be LOCKED!
+ */
static void
Destroy_Module( FT_Module module )
{
@@ -5028,9 +5155,9 @@
service = (FT_Service_Properties)interface;
if ( set )
- missing_func = (FT_Bool)( !service->set_property );
+ missing_func = FT_BOOL( !service->set_property );
else
- missing_func = (FT_Bool)( !service->get_property );
+ missing_func = FT_BOOL( !service->get_property );
if ( missing_func )
{
@@ -5156,13 +5283,6 @@
library->memory = memory;
-#ifdef FT_CONFIG_OPTION_PIC
- /* initialize position independent code containers */
- error = ft_pic_container_init( library );
- if ( error )
- goto Fail;
-#endif
-
library->version_major = FREETYPE_MAJOR;
library->version_minor = FREETYPE_MINOR;
library->version_patch = FREETYPE_PATCH;
@@ -5173,13 +5293,6 @@
*alibrary = library;
return FT_Err_Ok;
-
-#ifdef FT_CONFIG_OPTION_PIC
- Fail:
- ft_pic_container_destroy( library );
- FT_FREE( library );
- return error;
-#endif
}
@@ -5237,10 +5350,10 @@
*
* Example:
*
- * - the cff font driver uses the pshinter module in cff_size_done
- * - if the pshinter module is destroyed before the cff font driver,
- * opened FT_Face objects managed by the driver are not properly
- * destroyed, resulting in a memory leak
+ * - the cff font driver uses the pshinter module in cff_size_done
+ * - if the pshinter module is destroyed before the cff font driver,
+ * opened FT_Face objects managed by the driver are not properly
+ * destroyed, resulting in a memory leak
*
* Some faces are dependent on other faces, like Type42 faces that
* depend on TrueType faces synthesized internally.
@@ -5310,11 +5423,6 @@
}
#endif
-#ifdef FT_CONFIG_OPTION_PIC
- /* Destroy pic container contents */
- ft_pic_container_destroy( library );
-#endif
-
FT_FREE( library );
Exit:
@@ -5402,4 +5510,41 @@
}
+ /* documentation is in freetype.h */
+
+ FT_EXPORT_DEF( 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 )
+ {
+ TT_Face ttface;
+ SFNT_Service sfnt;
+
+
+ if ( !face ||
+ !aglyph_index ||
+ !acolor_index ||
+ !iterator ||
+ base_glyph >= (FT_UInt)face->num_glyphs )
+ return 0;
+
+ if ( !FT_IS_SFNT( face ) )
+ return 0;
+
+ ttface = (TT_Face)face;
+ sfnt = (SFNT_Service)ttface->sfnt;
+
+ if ( sfnt->get_colr_layer )
+ return sfnt->get_colr_layer( ttface,
+ base_glyph,
+ aglyph_index,
+ acolor_index,
+ iterator );
+ else
+ return 0;
+ }
+
+
/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftotval.c b/Build/source/libs/freetype2/freetype-src/src/base/ftotval.c
index a2944a7950c..007576ce6e2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftotval.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftotval.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftotval.c */
-/* */
-/* FreeType API for validating OpenType tables (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftotval.c
+ *
+ * FreeType API for validating OpenType tables (body).
+ *
+ * Copyright (C) 2004-2019 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 <ft2build.h>
#include FT_INTERNAL_DEBUG_H
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftoutln.c b/Build/source/libs/freetype2/freetype-src/src/base/ftoutln.c
index cb91321debf..00329b46c64 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftoutln.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftoutln.c
@@ -1,26 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftoutln.c */
-/* */
-/* FreeType outline management (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* All functions are declared in freetype.h. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftoutln.c
+ *
+ * FreeType outline management (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -31,14 +24,14 @@
#include FT_TRIGONOMETRY_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_outline
+#define FT_COMPONENT outline
static
@@ -296,15 +289,23 @@
}
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error )
- FT_Outline_New_Internal( FT_Memory memory,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline )
+ FT_Outline_New( FT_Library library,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline )
{
- FT_Error error;
+ FT_Error error;
+ FT_Memory memory;
+ if ( !library )
+ return FT_THROW( Invalid_Library_Handle );
+
+ memory = library->memory;
+
if ( !anoutline || !memory )
return FT_THROW( Invalid_Argument );
@@ -330,7 +331,7 @@
Fail:
anoutline->flags |= FT_OUTLINE_OWNER;
- FT_Outline_Done_Internal( memory, anoutline );
+ FT_Outline_Done( library, anoutline );
return error;
}
@@ -339,22 +340,6 @@
/* documentation is in ftoutln.h */
FT_EXPORT_DEF( FT_Error )
- FT_Outline_New( FT_Library library,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline )
- {
- if ( !library )
- return FT_THROW( Invalid_Library_Handle );
-
- return FT_Outline_New_Internal( library->memory, numPoints,
- numContours, anoutline );
- }
-
-
- /* documentation is in ftoutln.h */
-
- FT_EXPORT_DEF( FT_Error )
FT_Outline_Check( FT_Outline* outline )
{
if ( outline )
@@ -436,13 +421,23 @@
}
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error )
- FT_Outline_Done_Internal( FT_Memory memory,
- FT_Outline* outline )
+ FT_Outline_Done( FT_Library library,
+ FT_Outline* outline )
{
+ FT_Memory memory;
+
+
+ if ( !library )
+ return FT_THROW( Invalid_Library_Handle );
+
if ( !outline )
return FT_THROW( Invalid_Outline );
+ memory = library->memory;
+
if ( !memory )
return FT_THROW( Invalid_Argument );
@@ -460,21 +455,6 @@
/* documentation is in ftoutln.h */
- FT_EXPORT_DEF( FT_Error )
- FT_Outline_Done( FT_Library library,
- FT_Outline* outline )
- {
- /* check for valid `outline' in FT_Outline_Done_Internal() */
-
- if ( !library )
- return FT_THROW( Invalid_Library_Handle );
-
- return FT_Outline_Done_Internal( library->memory, outline );
- }
-
-
- /* documentation is in ftoutln.h */
-
FT_EXPORT_DEF( void )
FT_Outline_Get_CBox( const FT_Outline* outline,
FT_BBox *acbox )
@@ -619,6 +599,7 @@
FT_Error error;
FT_Renderer renderer;
FT_ListNode node;
+ FT_BBox cbox;
if ( !library )
@@ -630,6 +611,11 @@
if ( !params )
return FT_THROW( Invalid_Argument );
+ FT_Outline_Get_CBox( outline, &cbox );
+ if ( cbox.xMin < -0x1000000L || cbox.yMin < -0x1000000L ||
+ cbox.xMax > 0x1000000L || cbox.yMax > 0x1000000L )
+ return FT_THROW( Invalid_Outline );
+
renderer = library->cur_renderer;
node = library->renderers.head;
@@ -911,9 +897,9 @@
FT_Pos xstrength,
FT_Pos ystrength )
{
- FT_Vector* points;
- FT_Int c, first, last;
- FT_Int orientation;
+ FT_Vector* points;
+ FT_Int c, first, last;
+ FT_Orientation orientation;
if ( !outline )
@@ -1044,7 +1030,7 @@
FT_EXPORT_DEF( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline )
{
- FT_BBox cbox;
+ FT_BBox cbox = { 0, 0, 0, 0 };
FT_Int xshift, yshift;
FT_Vector* points;
FT_Vector v_prev, v_cur;
@@ -1090,7 +1076,8 @@
v_cur.y = points[n].y >> yshift;
area = ADD_LONG( area,
- ( v_cur.y - v_prev.y ) * ( v_cur.x + v_prev.x ) );
+ MUL_LONG( v_cur.y - v_prev.y,
+ v_cur.x + v_prev.x ) );
v_prev = v_cur;
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftpatent.c b/Build/source/libs/freetype2/freetype-src/src/base/ftpatent.c
index e23ee2e3f48..020f4646ebe 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftpatent.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftpatent.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ftpatent.c */
-/* */
-/* FreeType API for checking patented TrueType bytecode instructions */
-/* (body). Obsolete, retained for backward compatibility. */
-/* */
-/* Copyright 2007-2018 by */
-/* David Turner. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftpatent.c
+ *
+ * FreeType API for checking patented TrueType bytecode instructions
+ * (body). Obsolete, retained for backward compatibility.
+ *
+ * Copyright (C) 2007-2019 by
+ * David Turner.
+ *
+ * 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 <ft2build.h>
#include FT_FREETYPE_H
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftpfr.c b/Build/source/libs/freetype2/freetype-src/src/base/ftpfr.c
index bfe13520eb9..aeff1db8bd0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftpfr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftpfr.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftpfr.c */
-/* */
-/* FreeType API for accessing PFR-specific data (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftpfr.c
+ *
+ * FreeType API for accessing PFR-specific data (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
#include FT_INTERNAL_DEBUG_H
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftpic.c b/Build/source/libs/freetype2/freetype-src/src/base/ftpic.c
deleted file mode 100644
index 1492e1809a5..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftpic.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftpic.c */
-/* */
-/* The FreeType position independent code services (body). */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "basepic.h"
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* documentation is in ftpic.h */
-
- FT_BASE_DEF( FT_Error )
- ft_pic_container_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error;
-
-
- FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) );
-
- error = ft_base_pic_init( library );
- if ( error )
- return error;
-
- return FT_Err_Ok;
- }
-
-
- /* Destroy the contents of the container. */
- FT_BASE_DEF( void )
- ft_pic_container_destroy( FT_Library library )
- {
- ft_base_pic_free( library );
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftpsprop.c b/Build/source/libs/freetype2/freetype-src/src/base/ftpsprop.c
index 459b5e6054c..52b9d453ad2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftpsprop.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftpsprop.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ftpsprop.c */
-/* */
-/* Get and set properties of PostScript drivers (body). */
-/* See `ftdriver.h' for available properties. */
-/* */
-/* Copyright 2017-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftpsprop.c
+ *
+ * Get and set properties of PostScript drivers (body).
+ * See `ftdriver.h' for available properties.
+ *
+ * Copyright (C) 2017-2019 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 <ft2build.h>
@@ -25,14 +25,14 @@
#include FT_INTERNAL_POSTSCRIPT_PROPS_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_psprops
+#define FT_COMPONENT psprops
FT_BASE_CALLBACK_DEF( FT_Error )
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftrfork.c b/Build/source/libs/freetype2/freetype-src/src/base/ftrfork.c
index c3a2b9151ac..73b7eb0ded4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftrfork.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftrfork.c
@@ -1,38 +1,38 @@
-/***************************************************************************/
-/* */
-/* ftrfork.c */
-/* */
-/* Embedded resource forks accessor (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* Masatake YAMATO and Redhat K.K. */
-/* */
-/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
-/* derived from ftobjs.c. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* Development of the code in this file is support of */
-/* Information-technology Promotion Agency, Japan. */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftrfork.c
+ *
+ * Embedded resource forks accessor (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * Masatake YAMATO and Redhat K.K.
+ *
+ * FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are
+ * derived from ftobjs.c.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+/****************************************************************************
+ * Development of the code in this file is support of
+ * Information-technology Promotion Agency, Japan.
+ */
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_RFORK_H
-#include "basepic.h"
+
#include "ftbase.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_raccess
+#define FT_COMPONENT raccess
/*************************************************************************/
@@ -438,7 +438,7 @@
static FT_Error
raccess_guess_linux_double_from_file_name( FT_Library library,
- char * file_name,
+ char* file_name,
FT_Long *result_offset );
static char *
@@ -468,10 +468,10 @@
if ( errors[i] )
continue;
- errors[i] = (FT_RACCESS_GUESS_TABLE_GET[i].func)( library,
- stream, base_name,
- &(new_names[i]),
- &(offsets[i]) );
+ errors[i] = ft_raccess_guess_table[i].func( library,
+ stream, base_name,
+ &(new_names[i]),
+ &(offsets[i]) );
}
return;
@@ -488,7 +488,7 @@
if ( rule_index >= FT_RACCESS_N_RULES )
return FT_RFork_Rule_invalid;
- return FT_RACCESS_GUESS_TABLE_GET[rule_index].type;
+ return ft_raccess_guess_table[rule_index].type;
}
@@ -847,7 +847,7 @@
{
FT_Open_Args args2;
FT_Stream stream2;
- char * nouse = NULL;
+ char* nouse = NULL;
FT_Error error;
@@ -909,9 +909,9 @@
#else /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
- /*************************************************************************/
- /* Dummy function; just sets errors */
- /*************************************************************************/
+ /**************************************************************************
+ * Dummy function; just sets errors
+ */
FT_BASE_DEF( void )
FT_Raccess_Guess( FT_Library library,
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftsnames.c b/Build/source/libs/freetype2/freetype-src/src/base/ftsnames.c
index 90ea1e2be7b..7ab3fe3cfac 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftsnames.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftsnames.c
@@ -1,22 +1,22 @@
-/***************************************************************************/
-/* */
-/* ftsnames.c */
-/* */
-/* Simple interface to access SFNT name tables (which are used */
-/* to hold font names, copyright info, notices, etc.) (body). */
-/* */
-/* This is _not_ used to retrieve glyph names! */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftsnames.c
+ *
+ * Simple interface to access SFNT name tables (which are used
+ * to hold font names, copyright info, notices, etc.) (body).
+ *
+ * This is _not_ used to retrieve glyph names!
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -142,7 +142,45 @@
}
-#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
+#else /* !TT_CONFIG_OPTION_SFNT_NAMES */
+
+
+ FT_EXPORT_DEF( FT_UInt )
+ FT_Get_Sfnt_Name_Count( FT_Face face )
+ {
+ FT_UNUSED( face );
+
+ return 0;
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_Sfnt_Name( FT_Face face,
+ FT_UInt idx,
+ FT_SfntName *aname )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( idx );
+ FT_UNUSED( aname );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_Sfnt_LangTag( FT_Face face,
+ FT_UInt langID,
+ FT_SfntLangTag *alangTag )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( langID );
+ FT_UNUSED( alangTag );
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
+#endif /* !TT_CONFIG_OPTION_SFNT_NAMES */
/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c b/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
index 18df7dcfef6..4b0890d7fd5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftstream.c */
-/* */
-/* I/O stream support (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftstream.c
+ *
+ * I/O stream support (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -21,14 +21,14 @@
#include FT_INTERNAL_DEBUG_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_stream
+#define FT_COMPONENT stream
FT_BASE_DEF( void )
@@ -219,13 +219,14 @@
{
FT_Memory memory = stream->memory;
+
#ifdef FT_DEBUG_MEMORY
ft_mem_free( memory, *pbytes );
- *pbytes = NULL;
#else
FT_FREE( *pbytes );
#endif
}
+
*pbytes = NULL;
}
@@ -238,6 +239,8 @@
FT_ULong read_bytes;
+ FT_TRACE7(( "FT_Stream_EnterFrame: %ld bytes\n", count ));
+
/* check for nested frame access */
FT_ASSERT( stream && stream->cursor == 0 );
@@ -281,6 +284,7 @@
FT_FREE( stream->base );
error = FT_THROW( Invalid_Stream_Operation );
}
+
stream->cursor = stream->base;
stream->limit = stream->cursor + count;
stream->pos += read_bytes;
@@ -321,13 +325,16 @@
/* In this case, the loader code handles the 0-length table */
/* gracefully; however, stream.cursor is really set to 0 by the */
/* FT_Stream_EnterFrame() call, and this is not an error. */
- /* */
+
+ FT_TRACE7(( "FT_Stream_ExitFrame\n" ));
+
FT_ASSERT( stream );
if ( stream->read )
{
FT_Memory memory = stream->memory;
+
#ifdef FT_DEBUG_MEMORY
ft_mem_free( memory, stream->base );
stream->base = NULL;
@@ -335,6 +342,7 @@
FT_FREE( stream->base );
#endif
}
+
stream->cursor = NULL;
stream->limit = NULL;
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c b/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
index 6ae18190679..826062c94ec 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftstroke.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftstroke.c */
-/* */
-/* FreeType path stroker (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftstroke.c
+ *
+ * FreeType path stroker (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -24,15 +24,10 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
-#include "basepic.h"
-
- /* declare an extern to access `ft_outline_glyph_class' globally */
- /* allocated in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */
- /* macro to access it when FT_CONFIG_OPTION_PIC is defined */
-#ifndef FT_CONFIG_OPTION_PIC
+ /* declare an extern to access `ft_outline_glyph_class' globally */
+ /* allocated in `ftglyph.c' */
FT_CALLBACK_TABLE const FT_Glyph_Class ft_outline_glyph_class;
-#endif
/* documentation is in ftstroke.h */
@@ -372,6 +367,7 @@
/* it contains the `adjusted' starting coordinates */
border->num_points = --count;
border->points[start] = border->points[count];
+ border->tags[start] = border->tags[count];
if ( reverse )
{
@@ -436,8 +432,8 @@
}
else
{
- /* don't add zero-length lineto */
- if ( border->num_points > 0 &&
+ /* don't add zero-length lineto, but always add moveto */
+ if ( border->num_points > (FT_UInt)border->start &&
FT_IS_SMALL( border->points[border->num_points - 1].x - to->x ) &&
FT_IS_SMALL( border->points[border->num_points - 1].y - to->y ) )
return error;
@@ -2087,8 +2083,8 @@
/* documentation is in ftstroke.h */
/*
- * The following is very similar to FT_Outline_Decompose, except
- * that we do support opened paths, and do not scale the outline.
+ * The following is very similar to FT_Outline_Decompose, except
+ * that we do support opened paths, and do not scale the outline.
*/
FT_EXPORT_DEF( FT_Error )
FT_Stroker_ParseOutline( FT_Stroker stroker,
@@ -2306,17 +2302,12 @@
FT_Error error = FT_ERR( Invalid_Argument );
FT_Glyph glyph = NULL;
- /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
- FT_Library library = stroker->library;
-
- FT_UNUSED( library );
-
if ( !pglyph )
goto Exit;
glyph = *pglyph;
- if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
+ if ( !glyph || glyph->clazz != &ft_outline_glyph_class )
goto Exit;
{
@@ -2386,17 +2377,12 @@
FT_Error error = FT_ERR( Invalid_Argument );
FT_Glyph glyph = NULL;
- /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
- FT_Library library = stroker->library;
-
- FT_UNUSED( library );
-
if ( !pglyph )
goto Exit;
glyph = *pglyph;
- if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
+ if ( !glyph || glyph->clazz != &ft_outline_glyph_class )
goto Exit;
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftsynth.c b/Build/source/libs/freetype2/freetype-src/src/base/ftsynth.c
index c28346707bd..f87ed65e751 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftsynth.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftsynth.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftsynth.c */
-/* */
-/* FreeType synthesizing code for emboldening and slanting (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftsynth.c
+ *
+ * FreeType synthesizing code for emboldening and slanting (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -24,14 +24,14 @@
#include FT_BITMAP_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_synth
+#define FT_COMPONENT synth
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftsystem.c b/Build/source/libs/freetype2/freetype-src/src/base/ftsystem.c
index 6adebdb9383..f92b3a03d58 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftsystem.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftsystem.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* ftsystem.c */
-/* */
-/* ANSI-specific FreeType low-level system interface (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This file contains the default interface used by FreeType to access */
- /* low-level, i.e. memory management, i/o access as well as thread */
- /* synchronisation. It can be replaced by user-specific routines if */
- /* necessary. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftsystem.c
+ *
+ * ANSI-specific FreeType low-level system interface (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * This file contains the default interface used by FreeType to access
+ * low-level, i.e. memory management, i/o access as well as thread
+ * synchronisation. It can be replaced by user-specific routines if
+ * necessary.
+ *
+ */
#include <ft2build.h>
@@ -34,37 +34,39 @@
#include FT_TYPES_H
- /*************************************************************************/
- /* */
- /* MEMORY MANAGEMENT INTERFACE */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* It is not necessary to do any error checking for the */
- /* allocation-related functions. This will be done by the higher level */
- /* routines like ft_mem_alloc() or ft_mem_realloc(). */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_alloc */
- /* */
- /* <Description> */
- /* The memory allocation function. */
- /* */
- /* <Input> */
- /* memory :: A pointer to the memory object. */
- /* */
- /* size :: The requested size in bytes. */
- /* */
- /* <Return> */
- /* The address of newly allocated block. */
- /* */
+ /**************************************************************************
+ *
+ * MEMORY MANAGEMENT INTERFACE
+ *
+ */
+
+ /**************************************************************************
+ *
+ * It is not necessary to do any error checking for the
+ * allocation-related functions. This will be done by the higher level
+ * routines like ft_mem_alloc() or ft_mem_realloc().
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_alloc
+ *
+ * @Description:
+ * The memory allocation function.
+ *
+ * @Input:
+ * memory ::
+ * A pointer to the memory object.
+ *
+ * size ::
+ * The requested size in bytes.
+ *
+ * @Return:
+ * The address of newly allocated block.
+ */
FT_CALLBACK_DEF( void* )
ft_alloc( FT_Memory memory,
long size )
@@ -75,26 +77,30 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_realloc */
- /* */
- /* <Description> */
- /* The memory reallocation function. */
- /* */
- /* <Input> */
- /* memory :: A pointer to the memory object. */
- /* */
- /* cur_size :: The current size of the allocated memory block. */
- /* */
- /* new_size :: The newly requested size in bytes. */
- /* */
- /* block :: The current address of the block in memory. */
- /* */
- /* <Return> */
- /* The address of the reallocated memory block. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_realloc
+ *
+ * @Description:
+ * The memory reallocation function.
+ *
+ * @Input:
+ * memory ::
+ * A pointer to the memory object.
+ *
+ * cur_size ::
+ * The current size of the allocated memory block.
+ *
+ * new_size ::
+ * The newly requested size in bytes.
+ *
+ * block ::
+ * The current address of the block in memory.
+ *
+ * @Return:
+ * The address of the reallocated memory block.
+ */
FT_CALLBACK_DEF( void* )
ft_realloc( FT_Memory memory,
long cur_size,
@@ -108,19 +114,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_free */
- /* */
- /* <Description> */
- /* The memory release function. */
- /* */
- /* <Input> */
- /* memory :: A pointer to the memory object. */
- /* */
- /* block :: The address of block in memory to be freed. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_free
+ *
+ * @Description:
+ * The memory release function.
+ *
+ * @Input:
+ * memory ::
+ * A pointer to the memory object.
+ *
+ * block ::
+ * The address of block in memory to be freed.
+ */
FT_CALLBACK_DEF( void )
ft_free( FT_Memory memory,
void* block )
@@ -131,39 +139,40 @@
}
- /*************************************************************************/
- /* */
- /* RESOURCE MANAGEMENT INTERFACE */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * RESOURCE MANAGEMENT INTERFACE
+ *
+ */
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_io
+#define FT_COMPONENT io
/* We use the macro STREAM_FILE for convenience to extract the */
/* system-specific stream handle from a given FreeType stream object */
#define STREAM_FILE( stream ) ( (FT_FILE*)stream->descriptor.pointer )
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_ansi_stream_close */
- /* */
- /* <Description> */
- /* The function to close a stream. */
- /* */
- /* <Input> */
- /* stream :: A pointer to the stream object. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_ansi_stream_close
+ *
+ * @Description:
+ * The function to close a stream.
+ *
+ * @Input:
+ * stream ::
+ * A pointer to the stream object.
+ */
FT_CALLBACK_DEF( void )
ft_ansi_stream_close( FT_Stream stream )
{
@@ -175,28 +184,32 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_ansi_stream_io */
- /* */
- /* <Description> */
- /* The function to open a stream. */
- /* */
- /* <Input> */
- /* stream :: A pointer to the stream object. */
- /* */
- /* offset :: The position in the data stream to start reading. */
- /* */
- /* buffer :: The address of buffer to store the read data. */
- /* */
- /* count :: The number of bytes to read from the stream. */
- /* */
- /* <Return> */
- /* The number of bytes actually read. If `count' is zero (this is, */
- /* the function is used for seeking), a non-zero return value */
- /* indicates an error. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_ansi_stream_io
+ *
+ * @Description:
+ * The function to open a stream.
+ *
+ * @Input:
+ * stream ::
+ * A pointer to the stream object.
+ *
+ * offset ::
+ * The position in the data stream to start reading.
+ *
+ * buffer ::
+ * The address of buffer to store the read data.
+ *
+ * count ::
+ * The number of bytes to read from the stream.
+ *
+ * @Return:
+ * The number of bytes actually read. If `count' is zero (this is,
+ * the function is used for seeking), a non-zero return value
+ * indicates an error.
+ */
FT_CALLBACK_DEF( unsigned long )
ft_ansi_stream_io( FT_Stream stream,
unsigned long offset,
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/fttrigon.c b/Build/source/libs/freetype2/freetype-src/src/base/fttrigon.c
index d6dd098c426..38721977c78 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/fttrigon.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/fttrigon.c
@@ -1,33 +1,33 @@
-/***************************************************************************/
-/* */
-/* fttrigon.c */
-/* */
-/* FreeType trigonometric functions (body). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This is a fixed-point CORDIC implementation of trigonometric */
- /* functions as well as transformations between Cartesian and polar */
- /* coordinates. The angles are represented as 16.16 fixed-point values */
- /* in degrees, i.e., the angular resolution is 2^-16 degrees. Note that */
- /* only vectors longer than 2^16*180/pi (or at least 22 bits) on a */
- /* discrete Cartesian grid can have the same or better angular */
- /* resolution. Therefore, to maintain this precision, some functions */
- /* require an interim upscaling of the vectors, whereas others operate */
- /* with 24-bit long vectors directly. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * fttrigon.c
+ *
+ * FreeType trigonometric functions (body).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * This is a fixed-point CORDIC implementation of trigonometric
+ * functions as well as transformations between Cartesian and polar
+ * coordinates. The angles are represented as 16.16 fixed-point values
+ * in degrees, i.e., the angular resolution is 2^-16 degrees. Note that
+ * only vectors longer than 2^16*180/pi (or at least 22 bits) on a
+ * discrete Cartesian grid can have the same or better angular
+ * resolution. Therefore, to maintain this precision, some functions
+ * require an interim upscaling of the vectors, whereas others operate
+ * with 24-bit long vectors directly.
+ *
+ */
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
@@ -325,10 +325,10 @@
FT_EXPORT_DEF( FT_Fixed )
FT_Tan( FT_Angle angle )
{
- FT_Vector v;
+ FT_Vector v = { 1 << 24, 0 };
- FT_Vector_Unit( &v, angle );
+ ft_trig_pseudo_rotate( &v, angle );
return FT_DivFix( v.y, v.x );
}
@@ -372,14 +372,6 @@
}
- /* these macros return 0 for positive numbers,
- and -1 for negative ones */
-#define FT_SIGN_LONG( x ) ( (x) >> ( FT_SIZEOF_LONG * 8 - 1 ) )
-#define FT_SIGN_INT( x ) ( (x) >> ( FT_SIZEOF_INT * 8 - 1 ) )
-#define FT_SIGN_INT32( x ) ( (x) >> 31 )
-#define FT_SIGN_INT16( x ) ( (x) >> 15 )
-
-
/* documentation is in fttrigon.h */
FT_EXPORT_DEF( void )
@@ -408,8 +400,8 @@
FT_Int32 half = (FT_Int32)1L << ( shift - 1 );
- vec->x = ( v.x + half + FT_SIGN_LONG( v.x ) ) >> shift;
- vec->y = ( v.y + half + FT_SIGN_LONG( v.y ) ) >> shift;
+ vec->x = ( v.x + half - ( v.x < 0 ) ) >> shift;
+ vec->y = ( v.y + half - ( v.y < 0 ) ) >> shift;
}
else
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/fttype1.c b/Build/source/libs/freetype2/freetype-src/src/base/fttype1.c
index aa8f8ccbbb4..26d4f1c3a8a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/fttype1.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/fttype1.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* fttype1.c */
-/* */
-/* FreeType utility file for PS names support (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * fttype1.c
+ *
+ * FreeType utility file for PS names support (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftutil.c b/Build/source/libs/freetype2/freetype-src/src/base/ftutil.c
index 4de5f2c145d..92bd857e922 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftutil.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftutil.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftutil.c */
-/* */
-/* FreeType utility file for memory and list management (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftutil.c
+ *
+ * FreeType utility file for memory and list management (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -23,14 +23,14 @@
#include FT_LIST_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_memory
+#define FT_COMPONENT memory
/*************************************************************************/
@@ -54,7 +54,7 @@
FT_Error error;
FT_Pointer block = ft_mem_qalloc( memory, size, &error );
- if ( !error && size > 0 )
+ if ( !error && block && size > 0 )
FT_MEM_ZERO( block, size );
*p_error = error;
@@ -101,7 +101,7 @@
block = ft_mem_qrealloc( memory, item_size,
cur_count, new_count, block, &error );
- if ( !error && new_count > cur_count )
+ if ( !error && block && new_count > cur_count )
FT_MEM_ZERO( (char*)block + cur_count * item_size,
( new_count - cur_count ) * item_size );
@@ -185,7 +185,7 @@
FT_Pointer p = ft_mem_qalloc( memory, (FT_Long)size, &error );
- if ( !error && address )
+ if ( !error && address && size > 0 )
ft_memcpy( p, address, size );
*p_error = error;
@@ -236,7 +236,7 @@
/*************************************************************************/
#undef FT_COMPONENT
-#define FT_COMPONENT trace_list
+#define FT_COMPONENT list
/* documentation is in ftlist.h */
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftver.rc b/Build/source/libs/freetype2/freetype-src/src/base/ftver.rc
index a2903d58834..e02a88652c7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftver.rc
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftver.rc
@@ -4,7 +4,7 @@
/* */
/* FreeType VERSIONINFO resource for Windows DLLs. */
/* */
-/* Copyright 2018 by */
+/* Copyright (C) 2018-2019 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,9,1,0
-#define FT_VERSION_STR "2.9.1"
+#define FT_VERSION 2,10,0,0
+#define FT_VERSION_STR "2.10.0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION FT_VERSION
@@ -28,7 +28,7 @@ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#endif
-#ifdef _DLL
+#ifdef DLL_EXPORT
FILETYPE VFT_DLL
#define FT_FILENAME "freetype.dll"
#else
@@ -45,7 +45,7 @@ BEGIN
VALUE "FileVersion", FT_VERSION_STR
VALUE "ProductName", "FreeType"
VALUE "ProductVersion", FT_VERSION_STR
- VALUE "LegalCopyright", "\251 2018 The FreeType Project www.freetype.org. All rights reserved."
+ VALUE "LegalCopyright", "\251 2018-2019 The FreeType Project www.freetype.org. All rights reserved."
VALUE "InternalName", "freetype"
VALUE "OriginalFilename", FT_FILENAME
END
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftwinfnt.c b/Build/source/libs/freetype2/freetype-src/src/base/ftwinfnt.c
index 11bd28afb7a..59daa77031c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftwinfnt.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftwinfnt.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftwinfnt.c */
-/* */
-/* FreeType API for accessing Windows FNT specific info (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftwinfnt.c
+ *
+ * FreeType API for accessing Windows FNT specific info (body).
+ *
+ * Copyright (C) 2003-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/rules.mk b/Build/source/libs/freetype2/freetype-src/src/base/rules.mk
index e9805bd068a..4b24c6dce7e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/base/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -36,17 +36,17 @@ BASE_COMPILE := $(CC) $(ANSIFLAGS) \
# All files listed here should be included in `ftbase.c' (for a `single'
# build).
#
-BASE_SRC := $(BASE_DIR)/basepic.c \
- $(BASE_DIR)/ftadvanc.c \
+BASE_SRC := $(BASE_DIR)/ftadvanc.c \
$(BASE_DIR)/ftcalc.c \
+ $(BASE_DIR)/ftcolor.c \
$(BASE_DIR)/ftdbgmem.c \
+ $(BASE_DIR)/fterrors.c \
$(BASE_DIR)/ftfntfmt.c \
$(BASE_DIR)/ftgloadr.c \
$(BASE_DIR)/fthash.c \
$(BASE_DIR)/ftlcdfil.c \
$(BASE_DIR)/ftobjs.c \
$(BASE_DIR)/ftoutln.c \
- $(BASE_DIR)/ftpic.c \
$(BASE_DIR)/ftpsprop.c \
$(BASE_DIR)/ftrfork.c \
$(BASE_DIR)/ftsnames.c \
@@ -60,8 +60,7 @@ ifneq ($(ftmac_c),)
endif
# for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h')
-BASE_H := $(BASE_DIR)/basepic.h \
- $(BASE_DIR)/ftbase.h \
+BASE_H := $(BASE_DIR)/ftbase.h \
$(BASE_DIR)/md5.c \
$(BASE_DIR)/md5.h
diff --git a/Build/source/libs/freetype2/freetype-src/src/bdf/Jamfile b/Build/source/libs/freetype2/freetype-src/src/bdf/Jamfile
index d9e441c1887..a49c7f5d33f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bdf/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/bdf/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/bdf Jamfile
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/bdf/bdf.h b/Build/source/libs/freetype2/freetype-src/src/bdf/bdf.h
index 9012727c7ec..4018756f723 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bdf/bdf.h
+++ b/Build/source/libs/freetype2/freetype-src/src/bdf/bdf.h
@@ -51,11 +51,11 @@ FT_BEGIN_HEADER
/* end of bdfP.h */
- /*************************************************************************/
- /* */
- /* BDF font options macros and types. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * BDF font options macros and types.
+ *
+ */
#define BDF_CORRECT_METRICS 0x01 /* Correct invalid metrics when loading. */
@@ -93,11 +93,11 @@ FT_BEGIN_HEADER
void* client_data );
- /*************************************************************************/
- /* */
- /* BDF font property macros and types. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * BDF font property macros and types.
+ *
+ */
#define BDF_ATOM 1
@@ -123,11 +123,11 @@ FT_BEGIN_HEADER
} bdf_property_t;
- /*************************************************************************/
- /* */
- /* BDF font metric and glyph types. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * BDF font metric and glyph types.
+ *
+ */
typedef struct bdf_bbx_t_
@@ -147,7 +147,7 @@ FT_BEGIN_HEADER
typedef struct bdf_glyph_t_
{
char* name; /* Glyph name. */
- long encoding; /* Glyph encoding. */
+ unsigned long encoding; /* Glyph encoding. */
unsigned short swidth; /* Scalable width. */
unsigned short dwidth; /* Device width. */
bdf_bbx_t bbx; /* Glyph bounding box. */
@@ -158,20 +158,6 @@ FT_BEGIN_HEADER
} bdf_glyph_t;
- typedef struct bdf_glyphlist_t_
- {
- unsigned short pad; /* Pad to 4-byte boundary. */
- unsigned short bpp; /* Bits per pixel. */
- long start; /* Beginning encoding value of glyphs. */
- long end; /* Ending encoding value of glyphs. */
- bdf_glyph_t* glyphs; /* Glyphs themselves. */
- unsigned long glyphs_size; /* Glyph structures allocated. */
- unsigned long glyphs_used; /* Glyph structures used. */
- bdf_bbx_t bbx; /* Overall bounding box of glyphs. */
-
- } bdf_glyphlist_t;
-
-
typedef struct bdf_font_t_
{
char* name; /* Name of the font. */
@@ -185,7 +171,7 @@ FT_BEGIN_HEADER
unsigned short monowidth; /* Logical width for monowidth font. */
- long default_char; /* Encoding of the default glyph. */
+ unsigned long default_char; /* Encoding of the default glyph. */
long font_ascent; /* Font ascent. */
long font_descent; /* Font descent. */
@@ -205,16 +191,8 @@ FT_BEGIN_HEADER
char* comments; /* Font comments. */
unsigned long comments_len; /* Length of comment string. */
- bdf_glyphlist_t overflow; /* Storage used for glyph insertion. */
-
void* internal; /* Internal data for the font. */
- /* The size of the next two arrays must be in sync with the */
- /* size of the `have' array in the `bdf_parse_t' structure. */
- unsigned long nmod[34816]; /* Bitmap indicating modified glyphs. */
- unsigned long umod[34816]; /* Bitmap indicating modified */
- /* unencoded glyphs. */
- unsigned short modified; /* Boolean indicating font modified. */
unsigned short bpp; /* Bits per pixel. */
FT_Memory memory;
@@ -226,11 +204,11 @@ FT_BEGIN_HEADER
} bdf_font_t;
- /*************************************************************************/
- /* */
- /* Types for load/save callbacks. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Types for load/save callbacks.
+ *
+ */
/* Error codes. */
@@ -247,11 +225,11 @@ FT_BEGIN_HEADER
#define BDF_INVALID_LINE -100
- /*************************************************************************/
- /* */
- /* BDF font API. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * BDF font API.
+ *
+ */
FT_LOCAL( FT_Error )
bdf_load_font( FT_Stream stream,
diff --git a/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.c b/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.c
index ca937f89ce3..4a11843a1cb 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.c
@@ -41,14 +41,14 @@ THE SOFTWARE.
#include "bdferror.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_bdfdriver
+#define FT_COMPONENT bdfdriver
typedef struct BDF_CMapRec_
@@ -99,14 +99,17 @@ THE SOFTWARE.
min = 0;
max = cmap->num_encodings;
+ mid = ( min + max ) >> 1;
while ( min < max )
{
FT_ULong code;
- mid = ( min + max ) >> 1;
- code = (FT_ULong)encodings[mid].enc;
+ if ( mid > max || mid < min )
+ mid = ( min + max ) >> 1;
+
+ code = encodings[mid].enc;
if ( charcode == code )
{
@@ -120,6 +123,9 @@ THE SOFTWARE.
max = mid;
else
min = mid + 1;
+
+ /* prediction in a continuous block */
+ mid += charcode - code;
}
return result;
@@ -139,14 +145,17 @@ THE SOFTWARE.
min = 0;
max = cmap->num_encodings;
+ mid = ( min + max ) >> 1;
while ( min < max )
{
FT_ULong code; /* same as BDF_encoding_el.enc */
- mid = ( min + max ) >> 1;
- code = (FT_ULong)encodings[mid].enc;
+ if ( mid > max || mid < min )
+ mid = ( min + max ) >> 1;
+
+ code = encodings[mid].enc;
if ( charcode == code )
{
@@ -160,12 +169,15 @@ THE SOFTWARE.
max = mid;
else
min = mid + 1;
+
+ /* prediction in a continuous block */
+ mid += charcode - code;
}
charcode = 0;
if ( min < cmap->num_encodings )
{
- charcode = (FT_ULong)encodings[min].enc;
+ charcode = encodings[min].enc;
result = encodings[min].glyph + 1;
}
@@ -401,8 +413,7 @@ THE SOFTWARE.
bdfface->face_index = 0;
bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
- FT_FACE_FLAG_HORIZONTAL |
- FT_FACE_FLAG_FAST_GLYPHS;
+ FT_FACE_FLAG_HORIZONTAL;
prop = bdf_get_font_property( font, "SPACING" );
if ( prop && prop->format == BDF_ATOM &&
@@ -863,7 +874,7 @@ THE SOFTWARE.
/*
*
- * BDF SERVICE
+ * BDF SERVICE
*
*/
@@ -939,7 +950,7 @@ THE SOFTWARE.
/*
*
- * SERVICES LIST
+ * SERVICES LIST
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.h b/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.h
index 94550818c11..b37b84ea31f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/bdf/bdfdrivr.h
@@ -36,14 +36,10 @@ THE SOFTWARE.
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
typedef struct BDF_encoding_el_
{
- FT_Long enc;
+ FT_ULong enc;
FT_UShort glyph;
} BDF_encoding_el;
@@ -60,9 +56,6 @@ FT_BEGIN_HEADER
BDF_encoding_el* en_table;
- FT_CharMap charmap_handle;
- FT_CharMapRec charmap; /* a single charmap per face */
-
FT_UInt default_glyph;
} BDF_FaceRec, *BDF_Face;
diff --git a/Build/source/libs/freetype2/freetype-src/src/bdf/bdferror.h b/Build/source/libs/freetype2/freetype-src/src/bdf/bdferror.h
index b462c7d3b5c..dbe41c02ab1 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bdf/bdferror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/bdf/bdferror.h
@@ -20,11 +20,11 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
- /*************************************************************************/
- /* */
- /* This file is used to define the BDF error enumeration constants. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * This file is used to define the BDF error enumeration constants.
+ *
+ */
#ifndef BDFERROR_H_
#define BDFERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/bdf/bdflib.c b/Build/source/libs/freetype2/freetype-src/src/bdf/bdflib.c
index 2f5c99d5448..0898b0d470d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bdf/bdflib.c
+++ b/Build/source/libs/freetype2/freetype-src/src/bdf/bdflib.c
@@ -22,13 +22,13 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
- /*************************************************************************/
- /* */
- /* This file is based on bdf.c,v 1.22 2000/03/16 20:08:50 */
- /* */
- /* taken from Mark Leisher's xmbdfed package */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * This file is based on bdf.c,v 1.22 2000/03/16 20:08:50
+ *
+ * taken from Mark Leisher's xmbdfed package
+ *
+ */
#include <ft2build.h>
@@ -42,21 +42,21 @@
#include "bdferror.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_bdflib
+#define FT_COMPONENT bdflib
- /*************************************************************************/
- /* */
- /* Default BDF font options. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Default BDF font options.
+ *
+ */
static const bdf_options_t _bdf_opts =
@@ -68,11 +68,11 @@
};
- /*************************************************************************/
- /* */
- /* Builtin BDF font properties. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Builtin BDF font properties.
+ *
+ */
/* List of most properties that might appear in a font. Doesn't include */
/* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */
@@ -196,11 +196,10 @@
#define ACMSG9 "SWIDTH field missing at line %ld. Set automatically.\n"
#define ACMSG10 "DWIDTH field missing at line %ld. Set to glyph width.\n"
#define ACMSG11 "SIZE bits per pixel field adjusted to %hd.\n"
-#define ACMSG12 "Duplicate encoding %ld (%s) changed to unencoded.\n"
-#define ACMSG13 "Glyph %ld extra rows removed.\n"
-#define ACMSG14 "Glyph %ld extra columns removed.\n"
+#define ACMSG13 "Glyph %lu extra rows removed.\n"
+#define ACMSG14 "Glyph %lu extra columns removed.\n"
#define ACMSG15 "Incorrect glyph count: %ld indicated but %ld found.\n"
-#define ACMSG16 "Glyph %ld missing columns padded with zero bits.\n"
+#define ACMSG16 "Glyph %lu missing columns padded with zero bits.\n"
#define ACMSG17 "Adjusting number of glyphs to %ld.\n"
/* Error messages. */
@@ -219,11 +218,11 @@
#define DBGMSG2 " (0x%lX)\n"
- /*************************************************************************/
- /* */
- /* Utility types and functions. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Utility types and functions.
+ *
+ */
/* Function type for parsing lines of a BDF font. */
@@ -270,8 +269,6 @@
bdf_font_t* font;
bdf_options_t* opts;
- unsigned long have[34816]; /* must be in sync with `nmod' and `umod' */
- /* arrays from `bdf_font_t' structure */
_bdf_list_t list;
FT_Memory memory;
@@ -900,11 +897,11 @@
}
- /*************************************************************************/
- /* */
- /* BDF font file parsing flags and functions. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * BDF font file parsing flags and functions.
+ *
+ */
/* Parse flags. */
@@ -1232,7 +1229,7 @@
/* present, and the SPACING property should override the default */
/* spacing. */
if ( _bdf_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 )
- font->default_char = fp->value.l;
+ font->default_char = fp->value.ul;
else if ( _bdf_strncmp( name, "FONT_ASCENT", 11 ) == 0 )
font->font_ascent = fp->value.l;
else if ( _bdf_strncmp( name, "FONT_DESCENT", 12 ) == 0 )
@@ -1265,6 +1262,25 @@
};
+ static FT_Error
+ _bdf_parse_end( char* line,
+ unsigned long linelen,
+ unsigned long lineno,
+ void* call_data,
+ void* client_data )
+ {
+ /* a no-op; we ignore everything after `ENDFONT' */
+
+ FT_UNUSED( line );
+ FT_UNUSED( linelen );
+ FT_UNUSED( lineno );
+ FT_UNUSED( call_data );
+ FT_UNUSED( client_data );
+
+ return FT_Err_Ok;
+ }
+
+
/* Actually parse the glyph info and bitmaps. */
static FT_Error
_bdf_parse_glyphs( char* line,
@@ -1278,6 +1294,7 @@
unsigned char* bp;
unsigned long i, slen, nibbles;
+ _bdf_line_func_t* next;
_bdf_parse_t* p;
bdf_glyph_t* glyph;
bdf_font_t* font;
@@ -1285,11 +1302,11 @@
FT_Memory memory;
FT_Error error = FT_Err_Ok;
- FT_UNUSED( call_data );
FT_UNUSED( lineno ); /* only used in debug mode */
- p = (_bdf_parse_t *)client_data;
+ next = (_bdf_line_func_t *)call_data;
+ p = (_bdf_parse_t *) client_data;
font = p->font;
memory = font->memory;
@@ -1370,6 +1387,7 @@
by_encoding );
p->flags &= ~BDF_START_;
+ *next = _bdf_parse_end;
goto Exit;
}
@@ -1458,40 +1476,11 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2] );
- if ( p->glyph_enc < -1 )
+ if ( p->glyph_enc < -1 || p->glyph_enc >= 0x110000L )
p->glyph_enc = -1;
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
- /* Check that the encoding is in the Unicode range because */
- /* otherwise p->have (a bitmap with static size) overflows. */
- if ( p->glyph_enc > 0 &&
- (size_t)p->glyph_enc >= sizeof ( p->have ) /
- sizeof ( unsigned long ) * 32 )
- {
- FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "ENCODING" ));
- error = FT_THROW( Invalid_File_Format );
- goto Exit;
- }
-
- /* Check whether this encoding has already been encountered. */
- /* If it has then change it to unencoded so it gets added if */
- /* indicated. */
- if ( p->glyph_enc >= 0 )
- {
- if ( _bdf_glyph_modified( p->have, p->glyph_enc ) )
- {
- /* Emit a message saying a glyph has been moved to the */
- /* unencoded area. */
- FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG12,
- p->glyph_enc, p->glyph_name ));
- p->glyph_enc = -1;
- font->modified = 1;
- }
- else
- _bdf_set_glyph_modified( p->have, p->glyph_enc );
- }
-
if ( p->glyph_enc >= 0 )
{
/* Make sure there are enough glyphs allocated in case the */
@@ -1508,7 +1497,7 @@
glyph = font->glyphs + font->glyphs_used++;
glyph->name = p->glyph_name;
- glyph->encoding = p->glyph_enc;
+ glyph->encoding = (unsigned long)p->glyph_enc;
/* Reset the initial glyph info. */
p->glyph_name = NULL;
@@ -1532,7 +1521,7 @@
glyph = font->unencoded + font->unencoded_used;
glyph->name = p->glyph_name;
- glyph->encoding = (long)font->unencoded_used++;
+ glyph->encoding = font->unencoded_used++;
/* Reset the initial glyph info. */
p->glyph_name = NULL;
@@ -1556,6 +1545,9 @@
goto Exit;
}
+ if ( !( p->flags & BDF_ENCODING_ ) )
+ goto Missing_Encoding;
+
/* Point at the glyph being constructed. */
if ( p->glyph_enc == -1 )
glyph = font->unencoded + ( font->unencoded_used - 1 );
@@ -1573,7 +1565,6 @@
{
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG13, glyph->encoding ));
p->flags |= BDF_GLYPH_HEIGHT_CHECK_;
- font->modified = 1;
}
goto Exit;
@@ -1601,7 +1592,6 @@
{
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG16, glyph->encoding ));
p->flags |= BDF_GLYPH_WIDTH_CHECK_;
- font->modified = 1;
}
/* Remove possible garbage at the right. */
@@ -1616,7 +1606,6 @@
{
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
p->flags |= BDF_GLYPH_WIDTH_CHECK_;
- font->modified = 1;
}
p->row++;
@@ -1626,9 +1615,6 @@
/* Expect the SWIDTH (scalable width) field next. */
if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 )
{
- if ( !( p->flags & BDF_ENCODING_ ) )
- goto Missing_Encoding;
-
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
if ( error )
goto Exit;
@@ -1642,9 +1628,6 @@
/* Expect the DWIDTH (scalable width) field next. */
if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 )
{
- if ( !( p->flags & BDF_ENCODING_ ) )
- goto Missing_Encoding;
-
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
if ( error )
goto Exit;
@@ -1670,9 +1653,6 @@
/* Expect the BBX field next. */
if ( _bdf_strncmp( line, "BBX", 3 ) == 0 )
{
- if ( !( p->flags & BDF_ENCODING_ ) )
- goto Missing_Encoding;
-
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
if ( error )
goto Exit;
@@ -1720,14 +1700,7 @@
{
glyph->swidth = sw;
- if ( p->glyph_enc == -1 )
- _bdf_set_glyph_modified( font->umod,
- font->unencoded_used - 1 );
- else
- _bdf_set_glyph_modified( font->nmod, glyph->encoding );
-
p->flags |= BDF_SWIDTH_ADJ_;
- font->modified = 1;
}
}
@@ -1829,7 +1802,6 @@
goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent ));
- p->font->modified = 1;
}
if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 )
@@ -1842,7 +1814,6 @@
goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent ));
- p->font->modified = 1;
}
p->flags &= ~BDF_PROPS_;
@@ -1989,7 +1960,7 @@
if ( error )
goto Exit;
p->font->spacing = p->opts->font_spacing;
- p->font->default_char = -1;
+ p->font->default_char = ~0UL;
goto Exit;
}
@@ -2179,8 +2150,6 @@
goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent ));
- p->font->modified = 1;
-
*next = _bdf_parse_glyphs;
/* A special return value. */
@@ -2196,11 +2165,11 @@
}
- /*************************************************************************/
- /* */
- /* API. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * API.
+ *
+ */
FT_LOCAL_DEF( FT_Error )
@@ -2246,7 +2215,6 @@
{
FT_TRACE2(( "bdf_load_font: " ACMSG15, p->cnt,
p->font->glyphs_used + p->font->unencoded_used ));
- p->font->modified = 1;
}
/* Once the font has been loaded, adjust the overall font metrics if */
@@ -2259,7 +2227,6 @@
FT_TRACE2(( "bdf_load_font: " ACMSG3,
p->font->bbx.width, p->maxrb - p->minlb ));
p->font->bbx.width = (unsigned short)( p->maxrb - p->minlb );
- p->font->modified = 1;
}
if ( p->font->bbx.x_offset != p->minlb )
@@ -2267,7 +2234,6 @@
FT_TRACE2(( "bdf_load_font: " ACMSG4,
p->font->bbx.x_offset, p->minlb ));
p->font->bbx.x_offset = p->minlb;
- p->font->modified = 1;
}
if ( p->font->bbx.ascent != p->maxas )
@@ -2275,7 +2241,6 @@
FT_TRACE2(( "bdf_load_font: " ACMSG5,
p->font->bbx.ascent, p->maxas ));
p->font->bbx.ascent = p->maxas;
- p->font->modified = 1;
}
if ( p->font->bbx.descent != p->maxds )
@@ -2284,7 +2249,6 @@
p->font->bbx.descent, p->maxds ));
p->font->bbx.descent = p->maxds;
p->font->bbx.y_offset = (short)( -p->maxds );
- p->font->modified = 1;
}
if ( p->maxas + p->maxds != p->font->bbx.height )
@@ -2415,16 +2379,6 @@
FT_FREE( font->glyphs );
FT_FREE( font->unencoded );
- /* Free up the overflow storage if it was used. */
- for ( i = 0, glyphs = font->overflow.glyphs;
- i < font->overflow.glyphs_used; i++, glyphs++ )
- {
- FT_FREE( glyphs->name );
- FT_FREE( glyphs->bitmap );
- }
-
- FT_FREE( font->overflow.glyphs );
-
/* bdf_cleanup */
ft_hash_str_free( &(font->proptbl), memory );
diff --git a/Build/source/libs/freetype2/freetype-src/src/bzip2/Jamfile b/Build/source/libs/freetype2/freetype-src/src/bzip2/Jamfile
index 3548eab5975..4b77916a8d3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bzip2/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/bzip2/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/bzip2 Jamfile
#
-# Copyright 2010-2018 by
+# Copyright (C) 2010-2019 by
# Joel Klinghed
#
# based on `src/lzw/Jamfile'
diff --git a/Build/source/libs/freetype2/freetype-src/src/bzip2/ftbzip2.c b/Build/source/libs/freetype2/freetype-src/src/bzip2/ftbzip2.c
index 16019485a9b..1fda59b60ce 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bzip2/ftbzip2.c
+++ b/Build/source/libs/freetype2/freetype-src/src/bzip2/ftbzip2.c
@@ -1,25 +1,25 @@
-/***************************************************************************/
-/* */
-/* ftbzip2.c */
-/* */
-/* FreeType support for .bz2 compressed files. */
-/* */
-/* This optional component relies on libbz2. It should mainly be used to */
-/* parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2010-2018 by */
-/* Joel Klinghed. */
-/* */
-/* based on `src/gzip/ftgzip.c' */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftbzip2.c
+ *
+ * FreeType support for .bz2 compressed files.
+ *
+ * This optional component relies on libbz2. It should mainly be used to
+ * parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2010-2019 by
+ * Joel Klinghed.
+ *
+ * based on `src/gzip/ftgzip.c'
+ *
+ * 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 <ft2build.h>
@@ -43,10 +43,6 @@
#ifdef FT_CONFIG_OPTION_USE_BZIP2
-#ifdef FT_CONFIG_OPTION_PIC
-#error "bzip2 code does not support PIC yet"
-#endif
-
#define BZ_NO_STDIO /* Do not need FILE */
#include <bzlib.h>
@@ -475,8 +471,8 @@
memory = source->memory;
/*
- * check the header right now; this prevents allocating unnecessary
- * objects when we don't need them
+ * check the header right now; this prevents allocating unnecessary
+ * objects when we don't need them
*/
error = ft_bzip2_check_header( source );
if ( error )
diff --git a/Build/source/libs/freetype2/freetype-src/src/bzip2/rules.mk b/Build/source/libs/freetype2/freetype-src/src/bzip2/rules.mk
index 95954d75208..f365c1f76de 100644
--- a/Build/source/libs/freetype2/freetype-src/src/bzip2/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/bzip2/rules.mk
@@ -2,7 +2,7 @@
# FreeType 2 BZIP2 support configuration rules
#
-# Copyright 2010-2018 by
+# Copyright (C) 2010-2019 by
# Joel Klinghed.
#
# based on `src/lzw/rules.mk'
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/Jamfile b/Build/source/libs/freetype2/freetype-src/src/cache/Jamfile
index 53f4c7b6032..51f7196d1b0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/cache Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/cache/ftcache.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcache.c
index 1b425af911f..a6a3e63ef0b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcache.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcache.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcache.c */
-/* */
-/* The FreeType Caching sub-system (body only). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcache.c
+ *
+ * The FreeType Caching sub-system (body only).
+ *
+ * Copyright (C) 2000-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcbasic.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcbasic.c
index 994aa12286f..a473585ebcf 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcbasic.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcbasic.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcbasic.c */
-/* */
-/* The FreeType basic cache interface (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcbasic.c
+ *
+ * The FreeType basic cache interface (body).
+ *
+ * Copyright (C) 2003-2019 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 <ft2build.h>
@@ -27,11 +27,11 @@
#include "ftccback.h"
#include "ftcerror.h"
-#define FT_COMPONENT trace_cache
+#define FT_COMPONENT cache
/*
- * Basic Families
+ * Basic Families
*
*/
typedef struct FTC_BasicAttrRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.c
index 12ec585a253..f38ca44ddd3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftccache.c */
-/* */
-/* The FreeType internal cache interface (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftccache.c
+ *
+ * The FreeType internal cache interface (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -25,7 +25,7 @@
#include "ftcerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_cache
+#define FT_COMPONENT cache
#define FTC_HASH_MAX_LOAD 2
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.h
index 859c547e466..140ceadb117 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftccache.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftccache.h */
-/* */
-/* FreeType internal cache interface (specification). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftccache.h
+ *
+ * FreeType internal cache interface (specification).
+ *
+ * Copyright (C) 2000-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
#ifndef FTCCACHE_H_
@@ -42,17 +42,17 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* Each cache controls one or more cache nodes. Each node is part of */
- /* the global_lru list of the manager. Its `data' field however is used */
- /* as a reference count for now. */
- /* */
- /* A node can be anything, depending on the type of information held by */
- /* the cache. It can be an individual glyph image, a set of bitmaps */
- /* glyphs for a given size, some metrics, etc. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Each cache controls one or more cache nodes. Each node is part of
+ * the global_lru list of the manager. Its `data' field however is used
+ * as a reference count for now.
+ *
+ * A node can be anything, depending on the type of information held by
+ * the cache. It can be an individual glyph image, a set of bitmaps
+ * glyphs for a given size, some metrics, etc.
+ *
+ */
/* structure size should be 20 bytes on 32-bits machines */
typedef struct FTC_NodeRec_
@@ -302,11 +302,11 @@ FT_BEGIN_HEADER
*
* Example:
*
- * {
- * FTC_CACHE_TRYLOOP( cache )
- * error = load_data( ... );
- * FTC_CACHE_TRYLOOP_END()
- * }
+ * {
+ * FTC_CACHE_TRYLOOP( cache )
+ * error = load_data( ... );
+ * FTC_CACHE_TRYLOOP_END()
+ * }
*
*/
#define FTC_CACHE_TRYLOOP( cache ) \
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftccback.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftccback.h
index e51d8d6e559..9321bc3d4ee 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftccback.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftccback.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftccback.h */
-/* */
-/* Callback functions of the caching sub-system (specification only). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftccback.h
+ *
+ * Callback functions of the caching sub-system (specification only).
+ *
+ * Copyright (C) 2004-2019 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 FTCCBACK_H_
#define FTCCBACK_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftccmap.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftccmap.c
index d20b0f48fe7..76ba10e3e90 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftccmap.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftccmap.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftccmap.c */
-/* */
-/* FreeType CharMap cache (body) */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftccmap.c
+ *
+ * FreeType CharMap cache (body)
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -28,21 +28,21 @@
#include "ftcerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_cache
-
-
- /*************************************************************************/
- /* */
- /* Each FTC_CMapNode contains a simple array to map a range of character */
- /* codes to equivalent glyph indices. */
- /* */
- /* For now, the implementation is very basic: Each node maps a range of */
- /* 128 consecutive character codes to their corresponding glyph indices. */
- /* */
- /* We could do more complex things, but I don't think it is really very */
- /* useful. */
- /* */
- /*************************************************************************/
+#define FT_COMPONENT cache
+
+
+ /**************************************************************************
+ *
+ * Each FTC_CMapNode contains a simple array to map a range of character
+ * codes to equivalent glyph indices.
+ *
+ * For now, the implementation is very basic: Each node maps a range of
+ * 128 consecutive character codes to their corresponding glyph indices.
+ *
+ * We could do more complex things, but I don't think it is really very
+ * useful.
+ *
+ */
/* number of glyph indices / character code per node */
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcerror.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftcerror.h
index a26cd5935bc..e2d64171804 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcerror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcerror.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* ftcerror.h */
-/* */
-/* Caching sub-system error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the caching sub-system error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftcerror.h
+ *
+ * Caching sub-system error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the caching sub-system error enumeration
+ * constants.
+ *
+ */
#ifndef FTCERROR_H_
#define FTCERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.c
index 782cc0ed09e..2a0e97d4afa 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcglyph.c */
-/* */
-/* FreeType Glyph Image (FT_Glyph) cache (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcglyph.c
+ *
+ * FreeType Glyph Image (FT_Glyph) cache (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.h
index 23c24d223f4..5a1f0e2a748 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcglyph.h
@@ -1,101 +1,101 @@
-/***************************************************************************/
-/* */
-/* ftcglyph.h */
-/* */
-/* FreeType abstract glyph cache (specification). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcglyph.h
+ *
+ * FreeType abstract glyph cache (specification).
+ *
+ * Copyright (C) 2000-2019 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.
+ *
+ */
/*
*
- * FTC_GCache is an _abstract_ cache object optimized to store glyph
- * data. It works as follows:
+ * FTC_GCache is an _abstract_ cache object optimized to store glyph
+ * data. It works as follows:
*
- * - It manages FTC_GNode objects. Each one of them can hold one or more
- * glyph `items'. Item types are not specified in the FTC_GCache but
- * in classes that extend it.
+ * - It manages FTC_GNode objects. Each one of them can hold one or more
+ * glyph `items'. Item types are not specified in the FTC_GCache but
+ * in classes that extend it.
*
- * - Glyph attributes, like face ID, character size, render mode, etc.,
- * can be grouped into abstract `glyph families'. This avoids storing
- * the attributes within the FTC_GCache, since it is likely that many
- * FTC_GNodes will belong to the same family in typical uses.
+ * - Glyph attributes, like face ID, character size, render mode, etc.,
+ * can be grouped into abstract `glyph families'. This avoids storing
+ * the attributes within the FTC_GCache, since it is likely that many
+ * FTC_GNodes will belong to the same family in typical uses.
*
- * - Each FTC_GNode is thus an FTC_Node with two additional fields:
+ * - Each FTC_GNode is thus an FTC_Node with two additional fields:
*
- * * gindex: A glyph index, or the first index in a glyph range.
- * * family: A pointer to a glyph `family'.
+ * * gindex: A glyph index, or the first index in a glyph range.
+ * * family: A pointer to a glyph `family'.
*
- * - Family types are not fully specific in the FTC_Family type, but
- * by classes that extend it.
+ * - Family types are not fully specific in the FTC_Family type, but
+ * by classes that extend it.
*
- * Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
- * They share an FTC_Family sub-class called FTC_BasicFamily which is
- * used to store the following data: face ID, pixel/point sizes, load
- * flags. For more details see the file `src/cache/ftcbasic.c'.
+ * Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
+ * They share an FTC_Family sub-class called FTC_BasicFamily which is
+ * used to store the following data: face ID, pixel/point sizes, load
+ * flags. For more details see the file `src/cache/ftcbasic.c'.
*
- * Client applications can extend FTC_GNode with their own FTC_GNode
- * and FTC_Family sub-classes to implement more complex caches (e.g.,
- * handling automatic synthesis, like obliquing & emboldening, colored
- * glyphs, etc.).
+ * Client applications can extend FTC_GNode with their own FTC_GNode
+ * and FTC_Family sub-classes to implement more complex caches (e.g.,
+ * handling automatic synthesis, like obliquing & emboldening, colored
+ * glyphs, etc.).
*
- * See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
- * `ftcsbits.h', which both extend FTC_GCache with additional
- * optimizations.
+ * See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
+ * `ftcsbits.h', which both extend FTC_GCache with additional
+ * optimizations.
*
- * A typical FTC_GCache implementation must provide at least the
- * following:
+ * A typical FTC_GCache implementation must provide at least the
+ * following:
*
- * - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
- * my_node_new (must call FTC_GNode_Init)
- * my_node_free (must call FTC_GNode_Done)
- * my_node_compare (must call FTC_GNode_Compare)
- * my_node_remove_faceid (must call ftc_gnode_unselect in case
- * of match)
+ * - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
+ * my_node_new (must call FTC_GNode_Init)
+ * my_node_free (must call FTC_GNode_Done)
+ * my_node_compare (must call FTC_GNode_Compare)
+ * my_node_remove_faceid (must call ftc_gnode_unselect in case
+ * of match)
*
- * - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
- * my_family_compare
- * my_family_init
- * my_family_reset (optional)
- * my_family_done
+ * - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
+ * my_family_compare
+ * my_family_init
+ * my_family_reset (optional)
+ * my_family_done
*
- * - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
- * data.
+ * - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
+ * data.
*
- * - Constant structures for a FTC_GNodeClass.
+ * - Constant structures for a FTC_GNodeClass.
*
- * - MyCacheNew() can be implemented easily as a call to the convenience
- * function FTC_GCache_New.
+ * - MyCacheNew() can be implemented easily as a call to the convenience
+ * function FTC_GCache_New.
*
- * - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
- * automatically:
+ * - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
+ * automatically:
*
- * - Search for the corresponding family in the cache, or create
- * a new one if necessary. Put it in FTC_GQUERY(myquery).family
+ * - Search for the corresponding family in the cache, or create
+ * a new one if necessary. Put it in FTC_GQUERY(myquery).family
*
- * - Call FTC_Cache_Lookup.
+ * - Call FTC_Cache_Lookup.
*
- * If it returns NULL, you should create a new node, then call
- * ftc_cache_add as usual.
+ * If it returns NULL, you should create a new node, then call
+ * ftc_cache_add as usual.
*/
- /*************************************************************************/
- /* */
- /* Important: The functions defined in this file are only used to */
- /* implement an abstract glyph cache class. You need to */
- /* provide additional logic to implement a complete cache. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Important: The functions defined in this file are only used to
+ * implement an abstract glyph cache class. You need to
+ * provide additional logic to implement a complete cache.
+ *
+ */
/*************************************************************************/
@@ -125,11 +125,11 @@ FT_BEGIN_HEADER
/*
- * We can group glyphs into `families'. Each family correspond to a
- * given face ID, character size, transform, etc.
+ * We can group glyphs into `families'. Each family correspond to a
+ * given face ID, character size, transform, etc.
*
- * Families are implemented as MRU list nodes. They are
- * reference-counted.
+ * Families are implemented as MRU list nodes. They are
+ * reference-counted.
*/
typedef struct FTC_FamilyRec_
@@ -167,12 +167,12 @@ FT_BEGIN_HEADER
#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) )
- /*************************************************************************/
- /* */
- /* These functions are exported so that they can be called from */
- /* user-provided cache classes; otherwise, they are really part of the */
- /* cache sub-system internals. */
- /* */
+ /**************************************************************************
+ *
+ * These functions are exported so that they can be called from
+ * user-provided cache classes; otherwise, they are really part of the
+ * cache sub-system internals.
+ */
/* must be called by derived FTC_Node_InitFunc routines */
FT_LOCAL( void )
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.c
index 77a100153e0..9e64d51a22b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcimage.c */
-/* */
-/* FreeType Image cache (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcimage.c
+ *
+ * FreeType Image cache (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.h
index 24a221053b0..dcb101fabce 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcimage.h
@@ -1,35 +1,35 @@
-/***************************************************************************/
-/* */
-/* ftcimage.h */
-/* */
-/* FreeType Generic Image cache (specification) */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcimage.h
+ *
+ * FreeType Generic Image cache (specification)
+ *
+ * Copyright (C) 2000-2019 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.
+ *
+ */
/*
- * FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
- * image per cache node.
+ * FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
+ * image per cache node.
*
- * FTC_ICache extends FTC_GCache. For an implementation example,
- * see FTC_ImageCache in `src/cache/ftbasic.c'.
+ * FTC_ICache extends FTC_GCache. For an implementation example,
+ * see FTC_ImageCache in `src/cache/ftbasic.c'.
*/
- /*************************************************************************/
- /* */
- /* Each image cache really manages FT_Glyph objects. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Each image cache really manages FT_Glyph objects.
+ *
+ */
#ifndef FTCIMAGE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.c
index 2bcd9df5026..bd585968e3b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcmanag.c */
-/* */
-/* FreeType Cache Manager (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcmanag.c
+ *
+ * FreeType Cache Manager (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -26,13 +26,9 @@
#include "ftccback.h"
#include "ftcerror.h"
-#ifdef FT_CONFIG_OPTION_PIC
-#error "cache system does not support PIC yet"
-#endif
-
#undef FT_COMPONENT
-#define FT_COMPONENT trace_cache
+#define FT_COMPONENT cache
static FT_Error
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.h
index b4b47553568..60c66c8fc8f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmanag.h
@@ -1,47 +1,47 @@
-/***************************************************************************/
-/* */
-/* ftcmanag.h */
-/* */
-/* FreeType Cache Manager (specification). */
-/* */
-/* Copyright 2000-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* A cache manager is in charge of the following: */
- /* */
- /* - Maintain a mapping between generic FTC_FaceIDs and live FT_Face */
- /* objects. The mapping itself is performed through a user-provided */
- /* callback. However, the manager maintains a small cache of FT_Face */
- /* and FT_Size objects in order to speed up things considerably. */
- /* */
- /* - Manage one or more cache objects. Each cache is in charge of */
- /* holding a varying number of `cache nodes'. Each cache node */
- /* represents a minimal amount of individually accessible cached */
- /* data. For example, a cache node can be an FT_Glyph image */
- /* containing a vector outline, or some glyph metrics, or anything */
- /* else. */
- /* */
- /* Each cache node has a certain size in bytes that is added to the */
- /* total amount of `cache memory' within the manager. */
- /* */
- /* All cache nodes are located in a global LRU list, where the oldest */
- /* node is at the tail of the list. */
- /* */
- /* Each node belongs to a single cache, and includes a reference */
- /* count to avoid destroying it (due to caching). */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftcmanag.h
+ *
+ * FreeType Cache Manager (specification).
+ *
+ * Copyright (C) 2000-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * A cache manager is in charge of the following:
+ *
+ * - Maintain a mapping between generic FTC_FaceIDs and live FT_Face
+ * objects. The mapping itself is performed through a user-provided
+ * callback. However, the manager maintains a small cache of FT_Face
+ * and FT_Size objects in order to speed up things considerably.
+ *
+ * - Manage one or more cache objects. Each cache is in charge of
+ * holding a varying number of `cache nodes'. Each cache node
+ * represents a minimal amount of individually accessible cached
+ * data. For example, a cache node can be an FT_Glyph image
+ * containing a vector outline, or some glyph metrics, or anything
+ * else.
+ *
+ * Each cache node has a certain size in bytes that is added to the
+ * total amount of `cache memory' within the manager.
+ *
+ * All cache nodes are located in a global LRU list, where the oldest
+ * node is at the tail of the list.
+ *
+ * Each node belongs to a single cache, and includes a reference
+ * count to avoid destroying it (due to caching).
+ *
+ */
/*************************************************************************/
@@ -72,12 +72,12 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * @Section:
+ * cache_subsystem
+ *
+ */
#define FTC_MAX_FACES_DEFAULT 2
@@ -110,27 +110,28 @@ FT_BEGIN_HEADER
} FTC_ManagerRec;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_Compress */
- /* */
- /* <Description> */
- /* This function is used to check the state of the cache manager if */
- /* its `num_bytes' field is greater than its `max_bytes' field. It */
- /* will flush as many old cache nodes as possible (ignoring cache */
- /* nodes with a non-zero reference count). */
- /* */
- /* <InOut> */
- /* manager :: A handle to the cache manager. */
- /* */
- /* <Note> */
- /* Client applications should not call this function directly. It is */
- /* normally invoked by specific cache implementations. */
- /* */
- /* The reason this function is exported is to allow client-specific */
- /* cache classes. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * FTC_Manager_Compress
+ *
+ * @Description:
+ * This function is used to check the state of the cache manager if
+ * its `num_bytes' field is greater than its `max_bytes' field. It
+ * will flush as many old cache nodes as possible (ignoring cache
+ * nodes with a non-zero reference count).
+ *
+ * @InOut:
+ * manager ::
+ * A handle to the cache manager.
+ *
+ * @Note:
+ * Client applications should not call this function directly. It is
+ * normally invoked by specific cache implementations.
+ *
+ * The reason this function is exported is to allow client-specific
+ * cache classes.
+ */
FT_LOCAL( void )
FTC_Manager_Compress( FTC_Manager manager );
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.c
index 1087be4d890..18a7b800545 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcmru.c */
-/* */
-/* FreeType MRU support (body). */
-/* */
-/* Copyright 2003-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcmru.c
+ *
+ * FreeType MRU support (body).
+ *
+ * Copyright (C) 2003-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.h
index 82396b917d0..58721ed3409 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcmru.h
@@ -1,43 +1,43 @@
-/***************************************************************************/
-/* */
-/* ftcmru.h */
-/* */
-/* Simple MRU list-cache (specification). */
-/* */
-/* Copyright 2000-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* An MRU is a list that cannot hold more than a certain number of */
- /* elements (`max_elements'). All elements in the list are sorted in */
- /* least-recently-used order, i.e., the `oldest' element is at the tail */
- /* of the list. */
- /* */
- /* When doing a lookup (either through `Lookup()' or `Lookup_Node()'), */
- /* the list is searched for an element with the corresponding key. If */
- /* it is found, the element is moved to the head of the list and is */
- /* returned. */
- /* */
- /* If no corresponding element is found, the lookup routine will try to */
- /* obtain a new element with the relevant key. If the list is already */
- /* full, the oldest element from the list is discarded and replaced by a */
- /* new one; a new element is added to the list otherwise. */
- /* */
- /* Note that it is possible to pre-allocate the element list nodes. */
- /* This is handy if `max_elements' is sufficiently small, as it saves */
- /* allocations/releases during the lookup process. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftcmru.h
+ *
+ * Simple MRU list-cache (specification).
+ *
+ * Copyright (C) 2000-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * An MRU is a list that cannot hold more than a certain number of
+ * elements (`max_elements'). All elements in the list are sorted in
+ * least-recently-used order, i.e., the `oldest' element is at the tail
+ * of the list.
+ *
+ * When doing a lookup (either through `Lookup()' or `Lookup_Node()'),
+ * the list is searched for an element with the corresponding key. If
+ * it is found, the element is moved to the head of the list and is
+ * returned.
+ *
+ * If no corresponding element is found, the lookup routine will try to
+ * obtain a new element with the relevant key. If the list is already
+ * full, the oldest element from the list is discarded and replaced by a
+ * new one; a new element is added to the list otherwise.
+ *
+ * Note that it is possible to pre-allocate the element list nodes.
+ * This is handy if `max_elements' is sufficiently small, as it saves
+ * allocations/releases during the lookup process.
+ *
+ */
#ifndef FTCMRU_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
index 018f1ecdb71..06b46c896ee 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcsbits.c */
-/* */
-/* FreeType sbits manager (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcsbits.c
+ *
+ * FreeType sbits manager (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -27,7 +27,7 @@
#include "ftcerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_cache
+#define FT_COMPONENT cache
/*************************************************************************/
@@ -91,14 +91,14 @@
/*
- * This function tries to load a small bitmap within a given FTC_SNode.
- * Note that it returns a non-zero error code _only_ in the case of
- * out-of-memory condition. For all other errors (e.g., corresponding
- * to a bad font file), this function will mark the sbit as `unavailable'
- * and return a value of 0.
+ * This function tries to load a small bitmap within a given FTC_SNode.
+ * Note that it returns a non-zero error code _only_ in the case of
+ * out-of-memory condition. For all other errors (e.g., corresponding
+ * to a bad font file), this function will mark the sbit as `unavailable'
+ * and return a value of 0.
*
- * You should also read the comment within the @ftc_snode_compare
- * function below to see how out-of-memory is handled during a lookup.
+ * You should also read the comment within the @ftc_snode_compare
+ * function below to see how out-of-memory is handled during a lookup.
*/
static FT_Error
ftc_snode_load( FTC_SNode snode,
@@ -347,34 +347,34 @@
/*
- * The following code illustrates what to do when you want to
- * perform operations that may fail within a lookup function.
+ * The following code illustrates what to do when you want to
+ * perform operations that may fail within a lookup function.
*
- * Here, we want to load a small bitmap on-demand; we thus
- * need to call the `ftc_snode_load' function which may return
- * a non-zero error code only when we are out of memory (OOM).
+ * Here, we want to load a small bitmap on-demand; we thus
+ * need to call the `ftc_snode_load' function which may return
+ * a non-zero error code only when we are out of memory (OOM).
*
- * The correct thing to do is to use @FTC_CACHE_TRYLOOP and
- * @FTC_CACHE_TRYLOOP_END in order to implement a retry loop
- * that is capable of flushing the cache incrementally when
- * an OOM errors occur.
+ * The correct thing to do is to use @FTC_CACHE_TRYLOOP and
+ * @FTC_CACHE_TRYLOOP_END in order to implement a retry loop
+ * that is capable of flushing the cache incrementally when
+ * an OOM errors occur.
*
- * However, we need to `lock' the node before this operation to
- * prevent it from being flushed within the loop.
+ * However, we need to `lock' the node before this operation to
+ * prevent it from being flushed within the loop.
*
- * When we exit the loop, we unlock the node, then check the `error'
- * variable. If it is non-zero, this means that the cache was
- * completely flushed and that no usable memory was found to load
- * the bitmap.
+ * When we exit the loop, we unlock the node, then check the `error'
+ * variable. If it is non-zero, this means that the cache was
+ * completely flushed and that no usable memory was found to load
+ * the bitmap.
*
- * We then prefer to return a value of 0 (i.e., NO MATCH). This
- * ensures that the caller will try to allocate a new node.
- * This operation consequently _fail_ and the lookup function
- * returns the appropriate OOM error code.
+ * We then prefer to return a value of 0 (i.e., NO MATCH). This
+ * ensures that the caller will try to allocate a new node.
+ * This operation consequently _fail_ and the lookup function
+ * returns the appropriate OOM error code.
*
- * Note that `buffer == NULL && width == 255' is a hack used to
- * tag `unavailable' bitmaps in the array. We should never try
- * to load these.
+ * Note that `buffer == NULL && width == 255' is a hack used to
+ * tag `unavailable' bitmaps in the array. We should never try
+ * to load these.
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.h b/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.h
index 206a1bb3fc3..f1b71c28353 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftcsbits.h */
-/* */
-/* A small-bitmap cache (specification). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftcsbits.h
+ *
+ * A small-bitmap cache (specification).
+ *
+ * Copyright (C) 2000-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
#ifndef FTCSBITS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/rules.mk b/Build/source/libs/freetype2/freetype-src/src/cache/rules.mk
index 558935976dc..abcb2422391 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2000-2018 by
+# Copyright (C) 2000-2019 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/Build/source/libs/freetype2/freetype-src/src/cff/Jamfile b/Build/source/libs/freetype2/freetype-src/src/cff/Jamfile
index 53c904fcfe2..10f49cef121 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/cff Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/cff/cff.c b/Build/source/libs/freetype2/freetype-src/src/cff/cff.c
index 1a755d5dadd..a34ba9b710e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cff.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cff.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cff.c */
-/* */
-/* FreeType OpenType driver component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cff.c
+ *
+ * FreeType OpenType driver component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -23,7 +23,6 @@
#include "cffdrivr.c"
#include "cffgload.c"
#include "cffparse.c"
-#include "cffpic.c"
#include "cffload.c"
#include "cffobjs.c"
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.c
index e45ae1127bf..15cc94cafb0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffcmap.c */
-/* */
-/* CFF character mapping table (cmap) support (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffcmap.c
+ *
+ * CFF character mapping table (cmap) support (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -161,6 +161,9 @@
if ( !charset->sids )
return FT_THROW( No_Unicode_Glyph_Name );
+ if ( !psnames->unicodes_init )
+ return FT_THROW( Unimplemented_Feature );
+
return psnames->unicodes_init( memory,
unicodes,
cff->num_glyphs,
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.h
index 856a43dd1b9..07366bc7486 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffcmap.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffcmap.h */
-/* */
-/* CFF character mapping table (cmap) support (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffcmap.h
+ *
+ * CFF character mapping table (cmap) support (specification).
+ *
+ * Copyright (C) 2002-2019 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 CFFCMAP_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.c
index df896848da4..bbd5c403297 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffdrivr.c */
-/* */
-/* OpenType font driver implementation (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffdrivr.c
+ *
+ * OpenType font driver implementation (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -42,7 +42,6 @@
#endif
#include "cfferrs.h"
-#include "cffpic.h"
#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_GLYPH_DICT_H
@@ -50,14 +49,14 @@
#include FT_DRIVER_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cffdriver
+#define FT_COMPONENT cffdriver
/*************************************************************************/
@@ -73,38 +72,42 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_get_kerning */
- /* */
- /* <Description> */
- /* A driver method used to return the kerning vector between two */
- /* glyphs of the same face. */
- /* */
- /* <Input> */
- /* face :: A handle to the 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. */
- /* */
- /* <Output> */
- /* kerning :: The kerning vector. This is in font units for */
- /* scalable formats, and in pixels for fixed-sizes */
- /* formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this function. Other layouts, or more sophisticated */
- /* kernings, are out of scope of this method (the basic driver */
- /* interface is meant to be simple). */
- /* */
- /* They can be implemented by format-specific interfaces. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_get_kerning
+ *
+ * @Description:
+ * A driver method used to return the kerning vector between two
+ * glyphs of the same face.
+ *
+ * @Input:
+ * face ::
+ * A handle to the 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.
+ *
+ * @Output:
+ * kerning ::
+ * The kerning vector. This is in font units for
+ * scalable formats, and in pixels for fixed-sizes
+ * formats.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * @Note:
+ * Only horizontal layouts (left-to-right & right-to-left) are
+ * supported by this function. Other layouts, or more sophisticated
+ * kernings, are out of scope of this method (the basic driver
+ * interface is meant to be simple).
+ *
+ * They can be implemented by format-specific interfaces.
+ */
FT_CALLBACK_DEF( FT_Error )
cff_get_kerning( FT_Face ttface, /* TT_Face */
FT_UInt left_glyph,
@@ -125,32 +128,36 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_glyph_load */
- /* */
- /* <Description> */
- /* A driver method used to load a glyph within a given glyph slot. */
- /* */
- /* <Input> */
- /* slot :: A handle to the target slot object where the glyph */
- /* will be loaded. */
- /* */
- /* size :: A handle to the source face size at which the glyph */
- /* must be scaled, loaded, etc. */
- /* */
- /* glyph_index :: The index of the glyph in the font file. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_??? 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. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_glyph_load
+ *
+ * @Description:
+ * A driver method used to load a glyph within a given glyph slot.
+ *
+ * @Input:
+ * slot ::
+ * A handle to the target slot object where the glyph
+ * will be loaded.
+ *
+ * size ::
+ * A handle to the source face size at which the glyph
+ * must be scaled, loaded, etc.
+ *
+ * glyph_index ::
+ * The index of the glyph in the font file.
+ *
+ * load_flags ::
+ * A flag indicating what to load for this glyph. The
+ * FT_LOAD_??? 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.
+ */
FT_CALLBACK_DEF( FT_Error )
cff_glyph_load( FT_GlyphSlot cffslot, /* CFF_GlyphSlot */
FT_Size cffsize, /* CFF_Size */
@@ -302,7 +309,7 @@
/*
- * GLYPH DICT SERVICE
+ * GLYPH DICT SERVICE
*
*/
@@ -341,7 +348,7 @@
FT_ERROR(( "cff_get_glyph_name:"
" cannot get glyph name from a CFF2 font\n"
" "
- " without the `PSNames' module\n" ));
+ " without the `psnames' module\n" ));
error = FT_THROW( Missing_Module );
goto Exit;
}
@@ -352,7 +359,7 @@
FT_ERROR(( "cff_get_glyph_name:"
" cannot get glyph name from CFF & CEF fonts\n"
" "
- " without the `PSNames' module\n" ));
+ " without the `psnames' module\n" ));
error = FT_THROW( Missing_Module );
goto Exit;
}
@@ -408,7 +415,7 @@
FT_ERROR(( "cff_get_name_index:"
" cannot get glyph index from a CFF2 font\n"
" "
- " without the `PSNames' module\n" ));
+ " without the `psnames' module\n" ));
return 0;
}
}
@@ -446,7 +453,7 @@
/*
- * POSTSCRIPT INFO SERVICE
+ * POSTSCRIPT INFO SERVICE
*
*/
@@ -593,7 +600,7 @@
/*
- * POSTSCRIPT NAME SERVICE
+ * POSTSCRIPT NAME SERVICE
*
*/
@@ -654,8 +661,8 @@
FT_Library library = FT_FACE_LIBRARY( face );
- if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET &&
- cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET )
+ if ( cmap->clazz != &cff_cmap_encoding_class_rec &&
+ cmap->clazz != &cff_cmap_unicode_class_rec )
{
FT_Module sfnt = FT_Get_Module( library, "sfnt" );
FT_Service_TTCMaps service =
@@ -682,7 +689,7 @@
/*
- * CID INFO SERVICE
+ * CID INFO SERVICE
*
*/
static FT_Error
@@ -788,7 +795,7 @@
goto Fail;
}
- if ( glyph_index > cff->num_glyphs )
+ if ( glyph_index >= cff->num_glyphs )
{
error = FT_THROW( Invalid_Argument );
goto Fail;
@@ -818,7 +825,7 @@
/*
- * PROPERTY SERVICE
+ * PROPERTY SERVICE
*
*/
@@ -832,7 +839,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/*
- * MULTIPLE MASTER SERVICE
+ * MULTIPLE MASTER SERVICE
*
*/
@@ -861,6 +868,30 @@
static FT_Error
+ cff_set_mm_weightvector( CFF_Face face,
+ FT_UInt len,
+ FT_Fixed* weightvector )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->set_mm_weightvector( FT_FACE( face ), len, weightvector );
+ }
+
+
+ static FT_Error
+ cff_get_mm_weightvector( CFF_Face face,
+ FT_UInt* len,
+ FT_Fixed* weightvector )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->get_mm_weightvector( FT_FACE( face ), len, weightvector );
+ }
+
+
+ static FT_Error
cff_get_mm_var( CFF_Face face,
FT_MM_Var* *master )
{
@@ -909,22 +940,24 @@
FT_DEFINE_SERVICE_MULTIMASTERSREC(
cff_service_multi_masters,
- (FT_Get_MM_Func) NULL, /* get_mm */
- (FT_Set_MM_Design_Func) NULL, /* set_mm_design */
- (FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
- (FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
- (FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
- (FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */
- (FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */
- (FT_Set_Instance_Func) cff_set_instance, /* set_instance */
-
- (FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
- (FT_Done_Blend_Func) cff_done_blend /* done_blend */
+ (FT_Get_MM_Func) NULL, /* get_mm */
+ (FT_Set_MM_Design_Func) NULL, /* set_mm_design */
+ (FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
+ (FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
+ (FT_Set_Var_Design_Func) cff_set_var_design, /* set_var_design */
+ (FT_Get_Var_Design_Func) cff_get_var_design, /* get_var_design */
+ (FT_Set_Instance_Func) cff_set_instance, /* set_instance */
+ (FT_Set_MM_WeightVector_Func)cff_set_mm_weightvector, /* set_mm_weightvector */
+ (FT_Get_MM_WeightVector_Func)cff_get_mm_weightvector, /* get_mm_weightvector */
+
+ (FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
+ (FT_Done_Blend_Func) cff_done_blend /* done_blend */
)
/*
- * METRICS VARIATIONS SERVICE
+ * METRICS VARIATIONS SERVICE
*
*/
@@ -968,7 +1001,7 @@
/*
- * CFFLOAD SERVICE
+ * CFFLOAD SERVICE
*
*/
@@ -1001,54 +1034,54 @@
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
- FT_SERVICE_ID_MULTI_MASTERS, &CFF_SERVICE_MULTI_MASTERS_GET,
- FT_SERVICE_ID_METRICS_VARIATIONS, &CFF_SERVICE_METRICS_VAR_GET,
- FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
- FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
- FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
- FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
+ FT_SERVICE_ID_MULTI_MASTERS, &cff_service_multi_masters,
+ FT_SERVICE_ID_METRICS_VARIATIONS, &cff_service_metrics_variations,
+ FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
+ FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict,
+ FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
+ FT_SERVICE_ID_CID, &cff_service_cid_info,
+ FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
+ FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#elif !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES
FT_DEFINE_SERVICEDESCREC8(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
- FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
- FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
- FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
- FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
+ FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
+ FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict,
+ FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
+ FT_SERVICE_ID_CID, &cff_service_cid_info,
+ FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
+ FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#elif defined TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_DEFINE_SERVICEDESCREC9(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
- FT_SERVICE_ID_MULTI_MASTERS, &CFF_SERVICE_MULTI_MASTERS_GET,
- FT_SERVICE_ID_METRICS_VARIATIONS, &CFF_SERVICE_METRICS_VAR_GET,
- FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
- FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
- FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
+ FT_SERVICE_ID_MULTI_MASTERS, &cff_service_multi_masters,
+ FT_SERVICE_ID_METRICS_VARIATIONS, &cff_service_metrics_var,
+ FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
+ FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
+ FT_SERVICE_ID_CID, &cff_service_cid_info,
+ FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
+ FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#else
FT_DEFINE_SERVICEDESCREC7(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
- FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
- FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
- FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
+ FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name,
+ FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info,
+ FT_SERVICE_ID_CID, &cff_service_cid_info,
+ FT_SERVICE_ID_PROPERTIES, &cff_service_properties,
+ FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load
)
#endif
@@ -1062,27 +1095,16 @@
FT_Module_Interface result;
- /* CFF_SERVICES_GET dereferences `library' in PIC mode */
-#ifdef FT_CONFIG_OPTION_PIC
- if ( !driver )
- return NULL;
- library = driver->library;
- if ( !library )
- return NULL;
-#endif
-
- result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
+ result = ft_service_list_lookup( cff_services, module_interface );
if ( result )
return result;
- /* `driver' is not yet evaluated in non-PIC mode */
-#ifndef FT_CONFIG_OPTION_PIC
+ /* `driver' is not yet evaluated */
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
-#endif
/* we pass our request to the `sfnt' module */
sfnt = FT_Get_Module( library, "sfnt" );
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.h
index ad7c3ad70a8..f2bbcfe4f11 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffdrivr.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffdrivr.h */
-/* */
-/* High-level OpenType driver interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffdrivr.h
+ *
+ * High-level OpenType driver interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 CFFDRIVER_H_
@@ -26,10 +26,8 @@
FT_BEGIN_HEADER
-
FT_DECLARE_DRIVER( cff_driver_class )
-
FT_END_HEADER
#endif /* CFFDRIVER_H_ */
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cfferrs.h b/Build/source/libs/freetype2/freetype-src/src/cff/cfferrs.h
index b2e1bfaf9db..78d47a156db 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cfferrs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cfferrs.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* cfferrs.h */
-/* */
-/* CFF error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the CFF error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * cfferrs.h
+ *
+ * CFF error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the CFF error enumeration constants.
+ *
+ */
#ifndef CFFERRS_H_
#define CFFERRS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.c
index c58471ce861..36aa7d1b9ca 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffgload.c */
-/* */
-/* OpenType Glyph Loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffgload.c
+ *
+ * OpenType Glyph Loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -31,14 +31,14 @@
#include "cfferrs.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cffgload
+#define FT_COMPONENT cffgload
FT_LOCAL_DEF( FT_Error )
@@ -280,16 +280,16 @@
glyph->root.outline.n_points = 0;
glyph->root.outline.n_contours = 0;
- glyph->root.metrics.width = (FT_Pos)metrics.width << 6;
- glyph->root.metrics.height = (FT_Pos)metrics.height << 6;
+ glyph->root.metrics.width = (FT_Pos)metrics.width * 64;
+ glyph->root.metrics.height = (FT_Pos)metrics.height * 64;
- glyph->root.metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;
- glyph->root.metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;
- glyph->root.metrics.horiAdvance = (FT_Pos)metrics.horiAdvance << 6;
+ glyph->root.metrics.horiBearingX = (FT_Pos)metrics.horiBearingX * 64;
+ glyph->root.metrics.horiBearingY = (FT_Pos)metrics.horiBearingY * 64;
+ glyph->root.metrics.horiAdvance = (FT_Pos)metrics.horiAdvance * 64;
- glyph->root.metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;
- glyph->root.metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;
- glyph->root.metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6;
+ glyph->root.metrics.vertBearingX = (FT_Pos)metrics.vertBearingX * 64;
+ glyph->root.metrics.vertBearingY = (FT_Pos)metrics.vertBearingY * 64;
+ glyph->root.metrics.vertAdvance = (FT_Pos)metrics.vertAdvance * 64;
glyph->root.format = FT_GLYPH_FORMAT_BITMAP;
@@ -414,7 +414,7 @@
decoder.width_only = TRUE;
decoder.builder.no_recurse =
- (FT_Bool)( load_flags & FT_LOAD_NO_RECURSE );
+ FT_BOOL( load_flags & FT_LOAD_NO_RECURSE );
/* now load the unscaled outline */
error = cff_get_glyph_data( face, glyph_index,
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.h
index 803f3974fc7..754c55acf9e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffgload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffgload.h */
-/* */
-/* OpenType Glyph Loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffgload.h
+ *
+ * OpenType Glyph Loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 CFFGLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffload.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffload.c
index 1c6fe515667..12efd18dc4b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffload.c */
-/* */
-/* OpenType and CFF data/program tables loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffload.c
+ *
+ * OpenType and CFF data/program tables loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -196,14 +196,14 @@
}
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cffload
+#define FT_COMPONENT cffload
/* read an offset from the index's stream current position */
@@ -1398,7 +1398,14 @@
FT_UInt master;
- FT_ASSERT( lenNDV == 0 || NDV );
+ /* protect against malformed fonts */
+ if ( !( lenNDV == 0 || NDV ) )
+ {
+ FT_TRACE4(( " cff_blend_build_vector:"
+ " Malformed Normalize Design Vector data\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
blend->builtBV = FALSE;
@@ -2080,13 +2087,13 @@
/*
* Initialize the random number generator.
*
- * . If we have a face-specific seed, use it.
+ * - If we have a face-specific seed, use it.
* If non-zero, update it to a positive value.
*
- * . Otherwise, use the seed from the CFF driver.
+ * - Otherwise, use the seed from the CFF driver.
* If non-zero, update it to a positive value.
*
- * . If the random value is zero, use the seed given by the subfont's
+ * - If the random value is zero, use the seed given by the subfont's
* `initialRandomSeed' value.
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffload.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffload.h
index 14d14e21122..42d2696f33c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffload.h */
-/* */
-/* OpenType & CFF data/program tables loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffload.h
+ *
+ * OpenType & CFF data/program tables loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 CFFLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.c
index a2d7aec65ef..1a1030c0650 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffobjs.c */
-/* */
-/* OpenType objects manager (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffobjs.c
+ *
+ * OpenType objects manager (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -37,7 +37,6 @@
#include "cffobjs.h"
#include "cffload.h"
#include "cffcmap.h"
-#include "cffpic.h"
#include "cfferrs.h"
@@ -45,21 +44,21 @@
#include FT_SERVICE_CFF_TABLE_LOAD_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cffobjs
+#define FT_COMPONENT cffobjs
- /*************************************************************************/
- /* */
- /* SIZE FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SIZE FUNCTIONS
+ *
+ */
static PSH_Globals_Funcs
@@ -341,11 +340,11 @@
}
- /*************************************************************************/
- /* */
- /* SLOT FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SLOT FUNCTIONS
+ *
+ */
FT_LOCAL_DEF( void )
cff_slot_done( FT_GlyphSlot slot )
@@ -383,11 +382,11 @@
}
- /*************************************************************************/
- /* */
- /* FACE FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * FACE FUNCTIONS
+ *
+ */
static FT_String*
cff_strcpy( FT_Memory memory,
@@ -645,14 +644,14 @@
dict = &cff->top_font.font_dict;
- /* we need the `PSNames' module for CFF and CEF formats */
+ /* we need the `psnames' module for CFF and CEF formats */
/* which aren't CID-keyed */
if ( dict->cid_registry == 0xFFFFU && !psnames )
{
FT_ERROR(( "cff_face_init:"
" cannot open CFF & CEF fonts\n"
" "
- " without the `PSNames' module\n" ));
+ " without the `psnames' module\n" ));
error = FT_THROW( Missing_Module );
goto Exit;
}
@@ -965,10 +964,10 @@
/* assume "Regular" style if we don't know better */
cffface->style_name = cff_strcpy( memory, (char *)"Regular" );
- /*******************************************************************/
- /* */
- /* Compute face flags. */
- /* */
+ /********************************************************************
+ *
+ * Compute face flags.
+ */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
@@ -989,10 +988,10 @@
cffface->face_flags |= flags;
- /*******************************************************************/
- /* */
- /* Compute style flags. */
- /* */
+ /********************************************************************
+ *
+ * Compute style flags.
+ */
flags = 0;
if ( dict->italic_angle )
@@ -1028,10 +1027,10 @@
if ( dict->cid_registry != 0xFFFFU && pure_cff )
cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
- /*******************************************************************/
- /* */
- /* Compute char maps. */
- /* */
+ /********************************************************************
+ *
+ * Compute char maps.
+ */
/* Try to synthesize a Unicode charmap if there is none available */
/* already. If an OpenType font contains a Unicode "cmap", we */
@@ -1070,10 +1069,11 @@
nn = (FT_UInt)cffface->num_charmaps;
- error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
+ error = FT_CMap_New( &cff_cmap_unicode_class_rec, NULL,
&cmaprec, NULL );
if ( error &&
- FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
+ FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) &&
+ FT_ERR_NEQ( error, Unimplemented_Feature ) )
goto Exit;
error = FT_Err_Ok;
@@ -1094,19 +1094,19 @@
{
cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
- clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
+ clazz = &cff_cmap_encoding_class_rec;
}
else if ( encoding->offset == 1 )
{
cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
- clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
+ clazz = &cff_cmap_encoding_class_rec;
}
else
{
cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
- clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
+ clazz = &cff_cmap_encoding_class_rec;
}
error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.h
index 616a25b3b59..03bc78a67f4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffobjs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffobjs.h */
-/* */
-/* OpenType objects manager (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffobjs.h
+ *
+ * OpenType objects manager (specification).
+ *
+ * Copyright (C) 1996-2019 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 CFFOBJS_H_
@@ -51,10 +51,10 @@ FT_BEGIN_HEADER
cff_slot_init( FT_GlyphSlot slot );
- /*************************************************************************/
- /* */
- /* Face functions */
- /* */
+ /**************************************************************************
+ *
+ * Face functions
+ */
FT_LOCAL( FT_Error )
cff_face_init( FT_Stream stream,
FT_Face face, /* CFF_Face */
@@ -66,10 +66,10 @@ FT_BEGIN_HEADER
cff_face_done( FT_Face face ); /* CFF_Face */
- /*************************************************************************/
- /* */
- /* Driver functions */
- /* */
+ /**************************************************************************
+ *
+ * Driver functions
+ */
FT_LOCAL( FT_Error )
cff_driver_init( FT_Module module ); /* PS_Driver */
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.c
index b9611cf548a..fa806f1a905 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffparse.c */
-/* */
-/* CFF token stream parser (body) */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffparse.c
+ *
+ * CFF token stream parser (body)
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -22,20 +22,20 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_CALC_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_LIST_H
#include "cfferrs.h"
-#include "cffpic.h"
#include "cffload.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cffparse
+#define FT_COMPONENT cffparse
FT_LOCAL_DEF( FT_Error )
@@ -605,7 +605,6 @@
FT_Vector* offset = &dict->font_offset;
FT_ULong* upm = &dict->units_per_em;
FT_Byte** data = parser->stack;
- FT_Error error = FT_ERR( Stack_Underflow );
if ( parser->top >= parser->stack + 6 )
@@ -617,8 +616,6 @@
int i;
- error = FT_Err_Ok;
-
dict->has_font_matrix = TRUE;
/* We expect a well-formed font matrix, this is, the matrix elements */
@@ -647,22 +644,11 @@
( max_scaling - min_scaling ) < 0 ||
( max_scaling - min_scaling ) > 9 )
{
- /* Return default matrix in case of unlikely values. */
-
FT_TRACE1(( "cff_parse_font_matrix:"
" strange scaling values (minimum %d, maximum %d),\n"
" "
" using default matrix\n", min_scaling, max_scaling ));
-
- matrix->xx = 0x10000L;
- matrix->yx = 0;
- matrix->xy = 0;
- matrix->yy = 0x10000L;
- offset->x = 0;
- offset->y = 0;
- *upm = 1;
-
- goto Exit;
+ goto Unlikely;
}
for ( i = 0; i < 6; i++ )
@@ -709,10 +695,31 @@
(double)matrix->yy / *upm / 65536,
(double)offset->x / *upm / 65536,
(double)offset->y / *upm / 65536 ));
+
+ if ( !FT_Matrix_Check( matrix ) )
+ {
+ FT_TRACE1(( "cff_parse_font_matrix:"
+ " degenerate values, using default matrix\n" ));
+ goto Unlikely;
+ }
+
+ return FT_Err_Ok;
}
+ else
+ return FT_THROW( Stack_Underflow );
- Exit:
- return error;
+ Unlikely:
+ /* Return default matrix in case of unlikely values. */
+
+ matrix->xx = 0x10000L;
+ matrix->yx = 0;
+ matrix->xy = 0;
+ matrix->yy = 0x10000L;
+ offset->x = 0;
+ offset->y = 0;
+ *upm = 1;
+
+ return FT_Err_Ok;
}
@@ -802,7 +809,7 @@
#ifdef FT_DEBUG_LEVEL_TRACE
/* beautify tracing message */
- if ( ft_trace_levels[FT_COMPONENT] < 4 )
+ if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] < 4 )
FT_TRACE1(( "Multiple Master CFFs not supported yet,"
" handling first master design only\n" ));
else
@@ -1003,9 +1010,6 @@
CFF_FIELD( code, name, id, cff_kind_bool )
-#ifndef FT_CONFIG_OPTION_PIC
-
-
#undef CFF_FIELD
#undef CFF_FIELD_DELTA
@@ -1118,182 +1122,16 @@
#endif /* FT_DEBUG_LEVEL_TRACE */
-#else /* FT_CONFIG_OPTION_PIC */
-
-
- void
- FT_Destroy_Class_cff_field_handlers( FT_Library library,
- CFF_Field_Handler* clazz )
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ static void
+ destruct_t2s_item( FT_Memory memory,
+ void* data,
+ void* user )
{
- FT_Memory memory = library->memory;
-
-
- if ( clazz )
- FT_FREE( clazz );
+ FT_UNUSED( user );
+ memory->free( memory, data );
}
-
-
- FT_Error
- FT_Create_Class_cff_field_handlers( FT_Library library,
- CFF_Field_Handler** output_class )
- {
- CFF_Field_Handler* clazz = NULL;
- FT_Error error;
- FT_Memory memory = library->memory;
-
- int i = 0;
-
-
-#undef CFF_FIELD
-#define CFF_FIELD( code, name, id, kind ) i++;
-#undef CFF_FIELD_DELTA
-#define CFF_FIELD_DELTA( code, name, max, id ) i++;
-#undef CFF_FIELD_CALLBACK
-#define CFF_FIELD_CALLBACK( code, name, id ) i++;
-#undef CFF_FIELD_BLEND
-#define CFF_FIELD_BLEND( code, id ) i++;
-
-#include "cfftoken.h"
-
- i++; /* { 0, 0, 0, 0, 0, 0, 0 } */
-
- if ( FT_ALLOC( clazz, sizeof ( CFF_Field_Handler ) * i ) )
- return error;
-
- i = 0;
-
-
-#ifndef FT_DEBUG_LEVEL_TRACE
-
-
-#undef CFF_FIELD_CALLBACK
-#define CFF_FIELD_CALLBACK( code_, name_, id_ ) \
- clazz[i].kind = cff_kind_callback; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = 0; \
- clazz[i].size = 0; \
- clazz[i].reader = cff_parse_ ## name_; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- i++;
-
-#undef CFF_FIELD
-#define CFF_FIELD( code_, name_, id_, kind_ ) \
- clazz[i].kind = kind_; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
- clazz[i].size = FT_FIELD_SIZE( name_ ); \
- clazz[i].reader = 0; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- i++; \
-
-#undef CFF_FIELD_DELTA
-#define CFF_FIELD_DELTA( code_, name_, max_, id_ ) \
- clazz[i].kind = cff_kind_delta; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
- clazz[i].size = FT_FIELD_SIZE_DELTA( name_ ); \
- clazz[i].reader = 0; \
- clazz[i].array_max = max_; \
- clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
- i++;
-
-#undef CFF_FIELD_BLEND
-#define CFF_FIELD_BLEND( code_, id_ ) \
- clazz[i].kind = cff_kind_blend; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = 0; \
- clazz[i].size = 0; \
- clazz[i].reader = cff_parse_blend; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- i++;
-
-#include "cfftoken.h"
-
- clazz[i].kind = 0;
- clazz[i].code = 0;
- clazz[i].offset = 0;
- clazz[i].size = 0;
- clazz[i].reader = 0;
- clazz[i].array_max = 0;
- clazz[i].count_offset = 0;
-
-
-#else /* FT_DEBUG_LEVEL_TRACE */
-
-
-#undef CFF_FIELD_CALLBACK
-#define CFF_FIELD_CALLBACK( code_, name_, id_ ) \
- clazz[i].kind = cff_kind_callback; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = 0; \
- clazz[i].size = 0; \
- clazz[i].reader = cff_parse_ ## name_; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- clazz[i].id = id_; \
- i++;
-
-#undef CFF_FIELD
-#define CFF_FIELD( code_, name_, id_, kind_ ) \
- clazz[i].kind = kind_; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
- clazz[i].size = FT_FIELD_SIZE( name_ ); \
- clazz[i].reader = 0; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- clazz[i].id = id_; \
- i++; \
-
-#undef CFF_FIELD_DELTA
-#define CFF_FIELD_DELTA( code_, name_, max_, id_ ) \
- clazz[i].kind = cff_kind_delta; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
- clazz[i].size = FT_FIELD_SIZE_DELTA( name_ ); \
- clazz[i].reader = 0; \
- clazz[i].array_max = max_; \
- clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
- clazz[i].id = id_; \
- i++;
-
-#undef CFF_FIELD_BLEND
-#define CFF_FIELD_BLEND( code_, id_ ) \
- clazz[i].kind = cff_kind_blend; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = 0; \
- clazz[i].size = 0; \
- clazz[i].reader = cff_parse_blend; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- clazz[i].id = id_; \
- i++;
-
-#include "cfftoken.h"
-
- clazz[i].kind = 0;
- clazz[i].code = 0;
- clazz[i].offset = 0;
- clazz[i].size = 0;
- clazz[i].reader = 0;
- clazz[i].array_max = 0;
- clazz[i].count_offset = 0;
- clazz[i].id = 0;
-
-
-#endif /* FT_DEBUG_LEVEL_TRACE */
-
-
- *output_class = clazz;
-
- return FT_Err_Ok;
- }
-
-
-#endif /* FT_CONFIG_OPTION_PIC */
+#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
FT_LOCAL_DEF( FT_Error )
@@ -1301,17 +1139,21 @@
FT_Byte* start,
FT_Byte* limit )
{
+ FT_Byte* p = start;
+ FT_Error error = FT_Err_Ok;
+
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
PSAux_Service psaux;
-#endif
- FT_Byte* p = start;
- FT_Error error = FT_Err_Ok;
FT_Library library = parser->library;
+ FT_Memory memory = library->memory;
- FT_UNUSED( library );
+ FT_ListRec t2s;
+ FT_ZERO( &t2s );
+#endif
+
parser->top = parser->stack;
parser->start = start;
parser->limit = limit;
@@ -1321,6 +1163,7 @@
{
FT_UInt v = *p;
+
/* Opcode 31 is legacy MM T2 operator, not a number. */
/* Opcode 255 is reserved and should not appear in fonts; */
/* it is used internally for CFF2 blends. */
@@ -1369,8 +1212,9 @@
FT_Byte* charstring_base;
FT_ULong charstring_len;
- FT_Fixed* stack;
- FT_Byte* q;
+ FT_Fixed* stack;
+ FT_ListNode node;
+ FT_Byte* q;
charstring_base = ++p;
@@ -1405,17 +1249,29 @@
error = psaux->cff_decoder_funcs->parse_charstrings_old(
&decoder, charstring_base, charstring_len, 1 );
+ if ( error )
+ goto Exit;
/* Now copy the stack data in the temporary decoder object, */
/* converting it back to charstring number representations */
/* (this is ugly, I know). */
- /* */
- /* We overwrite the original top DICT charstring under the */
- /* assumption that the charstring representation of the result */
- /* of `cff_decoder_parse_charstrings' is shorter, which should */
- /* be always true. */
- q = charstring_base - 1;
+ node = (FT_ListNode)memory->alloc( memory,
+ sizeof ( FT_ListNodeRec ) );
+ if ( !node )
+ goto Out_Of_Memory_Error;
+
+ /* `5' is the conservative upper bound of required bytes per stack */
+ /* element. */
+ q = (FT_Byte*)memory->alloc( memory,
+ 5 * ( decoder.top - decoder.stack ) );
+ if ( !q )
+ goto Out_Of_Memory_Error;
+
+ node->data = q;
+
+ FT_List_Add( &t2s, node );
+
stack = decoder.stack;
while ( stack < decoder.top )
@@ -1431,7 +1287,7 @@
if ( *stack < 0 )
{
- num = (FT_ULong)-*stack;
+ num = (FT_ULong)NEG_LONG( *stack );
neg = 1;
}
else
@@ -1523,7 +1379,7 @@
}
code = code | parser->object_code;
- for ( field = CFF_FIELD_HANDLERS_GET; field->kind; field++ )
+ for ( field = cff_field_handlers; field->kind; field++ )
{
if ( field->code == (FT_Int)code )
{
@@ -1672,11 +1528,20 @@
parser->top = parser->stack;
}
p++;
- }
+ } /* while ( p < limit ) */
Exit:
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ FT_List_Finalize( &t2s, destruct_t2s_item, memory, NULL );
+#endif
return error;
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ Out_Of_Memory_Error:
+ error = FT_THROW( Out_Of_Memory );
+ goto Exit;
+#endif
+
Stack_Overflow:
error = FT_THROW( Invalid_Argument );
goto Exit;
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.h
index 8a8caeca446..bac32f94491 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cffparse.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffparse.h */
-/* */
-/* CFF token stream parser (specification) */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffparse.h
+ *
+ * CFF token stream parser (specification)
+ *
+ * Copyright (C) 1996-2019 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 CFFPARSE_H_
@@ -33,11 +33,11 @@ FT_BEGIN_HEADER
#define CFF_MAX_STACK_DEPTH 96
/*
- * There are plans to remove the `maxstack' operator in a forthcoming
- * revision of the CFF2 specification, increasing the (then static) stack
- * size to 513. By making the default stack size equal to the maximum
- * stack size, the operator is essentially disabled, which has the
- * desired effect in FreeType.
+ * There are plans to remove the `maxstack' operator in a forthcoming
+ * revision of the CFF2 specification, increasing the (then static) stack
+ * size to 513. By making the default stack size equal to the maximum
+ * stack size, the operator is essentially disabled, which has the
+ * desired effect in FreeType.
*/
#define CFF2_MAX_STACK 513
#define CFF2_DEFAULT_STACK 513
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffpic.c b/Build/source/libs/freetype2/freetype-src/src/cff/cffpic.c
deleted file mode 100644
index 08b74c7cf20..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffpic.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/***************************************************************************/
-/* */
-/* cffpic.c */
-/* */
-/* The FreeType position independent code services for cff module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "cffcmap.h"
-#include "cffpic.h"
-#include "cfferrs.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from cffdrivr.c */
- FT_Error
- FT_Create_Class_cff_services( FT_Library library,
- FT_ServiceDescRec** output_class );
- void
- FT_Destroy_Class_cff_services( FT_Library library,
- FT_ServiceDescRec* clazz );
- void
- FT_Init_Class_cff_service_ps_info( FT_Library library,
- FT_Service_PsInfoRec* clazz );
- void
- FT_Init_Class_cff_service_glyph_dict( FT_Library library,
- FT_Service_GlyphDictRec* clazz );
- void
- FT_Init_Class_cff_service_ps_name( FT_Library library,
- FT_Service_PsFontNameRec* clazz );
- void
- FT_Init_Class_cff_service_get_cmap_info( FT_Library library,
- FT_Service_TTCMapsRec* clazz );
- void
- FT_Init_Class_cff_service_cid_info( FT_Library library,
- FT_Service_CIDRec* clazz );
-
- /* forward declaration of PIC init functions from cffparse.c */
- FT_Error
- FT_Create_Class_cff_field_handlers( FT_Library library,
- CFF_Field_Handler** output_class );
- void
- FT_Destroy_Class_cff_field_handlers( FT_Library library,
- CFF_Field_Handler* clazz );
-
-
- void
- cff_driver_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->cff )
- {
- CffModulePIC* container = (CffModulePIC*)pic_container->cff;
-
-
- if ( container->cff_services )
- FT_Destroy_Class_cff_services( library,
- container->cff_services );
- container->cff_services = NULL;
- if ( container->cff_field_handlers )
- FT_Destroy_Class_cff_field_handlers(
- library, container->cff_field_handlers );
- container->cff_field_handlers = NULL;
- FT_FREE( container );
- pic_container->cff = NULL;
- }
- }
-
-
- FT_Error
- cff_driver_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- CffModulePIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC ( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->cff = container;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- error = FT_Create_Class_cff_services( library,
- &container->cff_services );
- if ( error )
- goto Exit;
-
- error = FT_Create_Class_cff_field_handlers(
- library, &container->cff_field_handlers );
- if ( error )
- goto Exit;
-
- FT_Init_Class_cff_service_ps_info(
- library, &container->cff_service_ps_info );
- FT_Init_Class_cff_service_glyph_dict(
- library, &container->cff_service_glyph_dict );
- FT_Init_Class_cff_service_ps_name(
- library, &container->cff_service_ps_name );
- FT_Init_Class_cff_service_get_cmap_info(
- library, &container->cff_service_get_cmap_info );
- FT_Init_Class_cff_service_cid_info(
- library, &container->cff_service_cid_info );
- FT_Init_Class_cff_cmap_encoding_class_rec(
- library, &container->cff_cmap_encoding_class_rec );
- FT_Init_Class_cff_cmap_unicode_class_rec(
- library, &container->cff_cmap_unicode_class_rec );
-
- Exit:
- if ( error )
- cff_driver_class_pic_free( library );
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cffpic.h b/Build/source/libs/freetype2/freetype-src/src/cff/cffpic.h
deleted file mode 100644
index 8ba4203a8de..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cffpic.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/***************************************************************************/
-/* */
-/* cffpic.h */
-/* */
-/* The FreeType position independent code services for cff module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 CFFPIC_H_
-#define CFFPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define CFF_SERVICE_PS_INFO_GET cff_service_ps_info
-#define CFF_SERVICE_GLYPH_DICT_GET cff_service_glyph_dict
-#define CFF_SERVICE_PS_NAME_GET cff_service_ps_name
-#define CFF_SERVICE_GET_CMAP_INFO_GET cff_service_get_cmap_info
-#define CFF_SERVICE_CID_INFO_GET cff_service_cid_info
-#define CFF_SERVICE_PROPERTIES_GET cff_service_properties
-#define CFF_SERVICES_GET cff_services
-#define CFF_SERVICE_MULTI_MASTERS_GET cff_service_multi_masters
-#define CFF_SERVICE_METRICS_VAR_GET cff_service_metrics_variations
-#define CFF_SERVICE_CFF_LOAD_GET cff_service_cff_load
-#define CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec
-#define CFF_CMAP_UNICODE_CLASS_REC_GET cff_cmap_unicode_class_rec
-#define CFF_FIELD_HANDLERS_GET cff_field_handlers
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#include FT_SERVICE_GLYPH_DICT_H
-#include "cffparse.h"
-#include FT_SERVICE_POSTSCRIPT_INFO_H
-#include FT_SERVICE_POSTSCRIPT_NAME_H
-#include FT_SERVICE_TT_CMAP_H
-#include FT_SERVICE_CID_H
-#include FT_SERVICE_PROPERTIES_H
-#include FT_SERVICE_MULTIPLE_MASTERS_H
-#include FT_SERVICE_METRICS_VARIATIONS_H
-
-
-FT_BEGIN_HEADER
-
- typedef struct CffModulePIC_
- {
- FT_ServiceDescRec* cff_services;
- CFF_Field_Handler* cff_field_handlers;
- FT_Service_PsInfoRec cff_service_ps_info;
- FT_Service_GlyphDictRec cff_service_glyph_dict;
- FT_Service_PsFontNameRec cff_service_ps_name;
- FT_Service_TTCMapsRec cff_service_get_cmap_info;
- FT_Service_CIDRec cff_service_cid_info;
- FT_Service_PropertiesRec cff_service_properties;
- FT_Service_MultiMastersRec cff_service_multi_masters;
- FT_Service_MetricsVariationsRec cff_service_metrics_variations;
- FT_Service_CFFLoadRec cff_service_cff_load;
- FT_CMap_ClassRec cff_cmap_encoding_class_rec;
- FT_CMap_ClassRec cff_cmap_unicode_class_rec;
-
- } CffModulePIC;
-
-
-#define GET_PIC( lib ) \
- ( (CffModulePIC*)( (lib)->pic_container.cff ) )
-
-#define CFF_SERVICE_PS_INFO_GET \
- ( GET_PIC( library )->cff_service_ps_info )
-#define CFF_SERVICE_GLYPH_DICT_GET \
- ( GET_PIC( library )->cff_service_glyph_dict )
-#define CFF_SERVICE_PS_NAME_GET \
- ( GET_PIC( library )->cff_service_ps_name )
-#define CFF_SERVICE_GET_CMAP_INFO_GET \
- ( GET_PIC( library )->cff_service_get_cmap_info )
-#define CFF_SERVICE_CID_INFO_GET \
- ( GET_PIC( library )->cff_service_cid_info )
-#define CFF_SERVICE_PROPERTIES_GET \
- ( GET_PIC( library )->cff_service_properties )
-#define CFF_SERVICES_GET \
- ( GET_PIC( library )->cff_services )
-#define CFF_SERVICE_MULTI_MASTERS_GET \
- ( GET_PIC( library )->cff_service_multi_masters )
-#define CFF_SERVICE_METRICS_VAR_GET \
- ( GET_PIC( library )->cff_service_metrics_variations )
-#define CFF_SERVICE_CFF_LOAD_GET \
- ( GET_PIC( library )->cff_service_cff_load )
-#define CFF_CMAP_ENCODING_CLASS_REC_GET \
- ( GET_PIC( library )->cff_cmap_encoding_class_rec )
-#define CFF_CMAP_UNICODE_CLASS_REC_GET \
- ( GET_PIC( library )->cff_cmap_unicode_class_rec )
-#define CFF_FIELD_HANDLERS_GET \
- ( GET_PIC( library )->cff_field_handlers )
-
- /* see cffpic.c for the implementation */
- void
- cff_driver_class_pic_free( FT_Library library );
-
- FT_Error
- cff_driver_class_pic_init( FT_Library library );
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* CFFPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/cfftoken.h b/Build/source/libs/freetype2/freetype-src/src/cff/cfftoken.h
index fec1ca20bde..063a7b3be07 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/cfftoken.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/cfftoken.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cfftoken.h */
-/* */
-/* CFF token definitions (specification only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cfftoken.h
+ *
+ * CFF token definitions (specification only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#undef FT_STRUCTURE
diff --git a/Build/source/libs/freetype2/freetype-src/src/cff/module.mk b/Build/source/libs/freetype2/freetype-src/src/cff/module.mk
index 8013d5dcab0..8c610959d37 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/cff/rules.mk b/Build/source/libs/freetype2/freetype-src/src/cff/rules.mk
index bce672927ec..6e2dc476eff 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cff/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/cff/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -31,8 +31,7 @@ CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c \
$(CFF_DIR)/cffgload.c \
$(CFF_DIR)/cffload.c \
$(CFF_DIR)/cffobjs.c \
- $(CFF_DIR)/cffparse.c \
- $(CFF_DIR)/cffpic.c
+ $(CFF_DIR)/cffparse.c
# CFF driver headers
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/Jamfile b/Build/source/libs/freetype2/freetype-src/src/cid/Jamfile
index 1c232fda3f7..1cfb702574a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/cid Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/cid/ciderrs.h b/Build/source/libs/freetype2/freetype-src/src/cid/ciderrs.h
index a5a86e3fc68..be80bed3bea 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/ciderrs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/ciderrs.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* ciderrs.h */
-/* */
-/* CID error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the CID error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ciderrs.h
+ *
+ * CID error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the CID error enumeration constants.
+ *
+ */
#ifndef CIDERRS_H_
#define CIDERRS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.c b/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.c
index d14f9a2cc97..f59f2880f09 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidgload.c */
-/* */
-/* CID-keyed Type1 Glyph Loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidgload.c
+ *
+ * CID-keyed Type1 Glyph Loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -31,14 +31,14 @@
#include "ciderrs.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cidgload
+#define FT_COMPONENT cidgload
FT_CALLBACK_DEF( FT_Error )
@@ -393,8 +393,7 @@
must_finish_decoder = TRUE;
/* set up the decoder */
- decoder.builder.no_recurse = FT_BOOL(
- ( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ) );
+ decoder.builder.no_recurse = FT_BOOL( load_flags & FT_LOAD_NO_RECURSE );
error = cid_load_glyph( &decoder, glyph_index );
if ( error )
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.h b/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.h
index 4811852ae43..37eba7ca7be 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidgload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidgload.h */
-/* */
-/* OpenType Glyph Loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidgload.h
+ *
+ * OpenType Glyph Loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 CIDGLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c b/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c
index 27cd09b3c35..fce3e37da74 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidload.c */
-/* */
-/* CID-keyed Type1 font loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidload.c
+ *
+ * CID-keyed Type1 font loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -21,20 +21,21 @@
#include FT_CONFIG_CONFIG_H
#include FT_MULTIPLE_MASTERS_H
#include FT_INTERNAL_TYPE1_TYPES_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include "cidload.h"
#include "ciderrs.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cidload
+#define FT_COMPONENT cidload
/* read a single offset */
@@ -81,6 +82,8 @@
/* if the keyword has a dedicated callback, call it */
if ( keyword->type == T1_FIELD_TYPE_CALLBACK )
{
+ FT_TRACE4(( " %s", keyword->ident ));
+
keyword->reader( (FT_Face)face, parser );
error = parser->root.error;
goto Exit;
@@ -131,6 +134,8 @@
}
}
+ FT_TRACE4(( " %s", keyword->ident ));
+
dummy_object = object;
/* now, load the keyword data in the object's field(s) */
@@ -141,12 +146,15 @@
else
error = cid_parser_load_field( &loader->parser,
keyword, &dummy_object );
+
+ FT_TRACE4(( "\n" ));
+
Exit:
return error;
}
- FT_CALLBACK_DEF( FT_Error )
+ FT_CALLBACK_DEF( void )
cid_parse_font_matrix( CID_Face face,
CID_Parser* parser )
{
@@ -171,14 +179,25 @@
result = cid_parser_to_fixed_array( parser, 6, temp, 3 );
if ( result < 6 )
- return FT_THROW( Invalid_File_Format );
+ {
+ FT_ERROR(( "cid_parse_font_matrix: not enough matrix elements\n" ));
+ goto Exit;
+ }
+
+ FT_TRACE4(( " [%f %f %f %f %f %f]\n",
+ (double)temp[0] / 65536 / 1000,
+ (double)temp[1] / 65536 / 1000,
+ (double)temp[2] / 65536 / 1000,
+ (double)temp[3] / 65536 / 1000,
+ (double)temp[4] / 65536 / 1000,
+ (double)temp[5] / 65536 / 1000 ));
temp_scale = FT_ABS( temp[3] );
if ( temp_scale == 0 )
{
FT_ERROR(( "cid_parse_font_matrix: invalid font matrix\n" ));
- return FT_THROW( Invalid_File_Format );
+ goto Exit;
}
/* atypical case */
@@ -200,16 +219,24 @@
matrix->xy = temp[2];
matrix->yy = temp[3];
+ if ( !FT_Matrix_Check( matrix ) )
+ {
+ FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" ));
+ parser->root.error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
/* note that the font offsets are expressed in integer font units */
offset->x = temp[4] >> 16;
offset->y = temp[5] >> 16;
}
- return FT_Err_Ok;
+ Exit:
+ return;
}
- FT_CALLBACK_DEF( FT_Error )
+ FT_CALLBACK_DEF( void )
parse_fd_array( CID_Face face,
CID_Parser* parser )
{
@@ -224,10 +251,11 @@
if ( num_dicts < 0 )
{
FT_ERROR(( "parse_fd_array: invalid number of dictionaries\n" ));
- error = FT_THROW( Invalid_File_Format );
goto Exit;
}
+ FT_TRACE4(( " %d\n", num_dicts ));
+
/*
* A single entry in the FDArray must (at least) contain the following
* structure elements.
@@ -263,27 +291,31 @@
cid->num_dicts = num_dicts;
- /* don't forget to set a few defaults */
+ /* set some default values (the same as for Type 1 fonts) */
for ( n = 0; n < cid->num_dicts; n++ )
{
CID_FaceDict dict = cid->font_dicts + n;
- /* default value for lenIV */
- dict->private_dict.lenIV = 4;
+ dict->private_dict.blue_shift = 7;
+ dict->private_dict.blue_fuzz = 1;
+ dict->private_dict.lenIV = 4;
+ dict->private_dict.expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
+ dict->private_dict.blue_scale = (FT_Fixed)(
+ 0.039625 * 0x10000L * 1000 );
}
}
Exit:
- return error;
+ return;
}
- /* by mistake, `expansion_factor' appears both in PS_PrivateRec */
+ /* By mistake, `expansion_factor' appears both in PS_PrivateRec */
/* and CID_FaceDictRec (both are public header files and can't */
- /* changed); we simply copy the value */
+ /* changed). We simply copy the value. */
- FT_CALLBACK_DEF( FT_Error )
+ FT_CALLBACK_DEF( void )
parse_expansion_factor( CID_Face face,
CID_Parser* parser )
{
@@ -296,9 +328,43 @@
dict->expansion_factor = cid_parser_to_fixed( parser, 0 );
dict->private_dict.expansion_factor = dict->expansion_factor;
+
+ FT_TRACE4(( "%d\n", dict->expansion_factor ));
+ }
+
+ return;
+ }
+
+
+ /* By mistake, `CID_FaceDictRec' doesn't contain a field for the */
+ /* `FontName' keyword. FreeType doesn't need it, but it is nice */
+ /* to catch it for producing better trace output. */
+
+ FT_CALLBACK_DEF( void )
+ parse_font_name( CID_Face face,
+ CID_Parser* parser )
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
+ {
+ T1_TokenRec token;
+ FT_UInt len;
+
+
+ cid_parser_to_token( parser, &token );
+
+ len = (FT_UInt)( token.limit - token.start );
+ if ( len )
+ FT_TRACE4(( " %.*s\n", len, token.start ));
+ else
+ FT_TRACE4(( " <no value>\n" ));
}
+#else
+ FT_UNUSED( face );
+ FT_UNUSED( parser );
+#endif
- return FT_Err_Ok;
+ return;
}
@@ -311,6 +377,7 @@
T1_FIELD_CALLBACK( "FDArray", parse_fd_array, 0 )
T1_FIELD_CALLBACK( "FontMatrix", cid_parse_font_matrix, 0 )
T1_FIELD_CALLBACK( "ExpansionFactor", parse_expansion_factor, 0 )
+ T1_FIELD_CALLBACK( "FontName", parse_font_name, 0 )
{ 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }
};
@@ -356,7 +423,16 @@
/* if /FDArray was found, then cid->num_dicts is > 0, and */
/* we can start increasing parser->num_dict */
if ( face->cid.num_dicts > 0 )
+ {
parser->num_dict++;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE4(( " FontDict %d", parser->num_dict ));
+ if ( parser->num_dict > face->cid.num_dicts )
+ FT_TRACE4(( " (ignored)" ));
+ FT_TRACE4(( "\n" ));
+#endif
+ }
}
}
@@ -757,7 +833,7 @@
if ( cid->fd_bytes < 0 || cid->gd_bytes < 1 )
{
- FT_ERROR(( "cid_parse_dict:"
+ FT_ERROR(( "cid_face_open:"
" Invalid `FDBytes' or `GDBytes' value\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -766,7 +842,7 @@
/* allow at most 32bit offsets */
if ( cid->fd_bytes > 4 || cid->gd_bytes > 4 )
{
- FT_ERROR(( "cid_parse_dict:"
+ FT_ERROR(( "cid_face_open:"
" Values of `FDBytes' or `GDBytes' larger than 4\n"
" "
" are not supported\n" ));
@@ -782,17 +858,36 @@
CID_FaceDict dict = cid->font_dicts + n;
+ /* the upper limits are ad-hoc values */
+ if ( dict->private_dict.blue_shift > 1000 ||
+ dict->private_dict.blue_shift < 0 )
+ {
+ FT_TRACE2(( "cid_face_open:"
+ " setting unlikely BlueShift value %d to default (7)\n",
+ dict->private_dict.blue_shift ));
+ dict->private_dict.blue_shift = 7;
+ }
+
+ if ( dict->private_dict.blue_fuzz > 1000 ||
+ dict->private_dict.blue_fuzz < 0 )
+ {
+ FT_TRACE2(( "cid_face_open:"
+ " setting unlikely BlueFuzz value %d to default (1)\n",
+ dict->private_dict.blue_fuzz ));
+ dict->private_dict.blue_fuzz = 1;
+ }
+
if ( dict->sd_bytes < 0 ||
( dict->num_subrs && dict->sd_bytes < 1 ) )
{
- FT_ERROR(( "cid_parse_dict: Invalid `SDBytes' value\n" ));
+ FT_ERROR(( "cid_face_open: Invalid `SDBytes' value\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
if ( dict->sd_bytes > 4 )
{
- FT_ERROR(( "cid_parse_dict:"
+ FT_ERROR(( "cid_face_open:"
" Values of `SDBytes' larger than 4"
" are not supported\n" ));
error = FT_THROW( Invalid_File_Format );
@@ -801,7 +896,7 @@
if ( dict->subrmap_offset > binary_length )
{
- FT_ERROR(( "cid_parse_dict: Invalid `SubrMapOffset' value\n" ));
+ FT_ERROR(( "cid_face_open: Invalid `SubrMapOffset' value\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -812,7 +907,7 @@
dict->num_subrs > ( binary_length - dict->subrmap_offset ) /
(FT_UInt)dict->sd_bytes ) )
{
- FT_ERROR(( "cid_parse_dict: Invalid `SubrCount' value\n" ));
+ FT_ERROR(( "cid_face_open: Invalid `SubrCount' value\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -820,7 +915,7 @@
if ( cid->cidmap_offset > binary_length )
{
- FT_ERROR(( "cid_parse_dict: Invalid `CIDMapOffset' value\n" ));
+ FT_ERROR(( "cid_face_open: Invalid `CIDMapOffset' value\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -829,7 +924,7 @@
cid->cid_count >
( binary_length - cid->cidmap_offset ) / entry_len )
{
- FT_ERROR(( "cid_parse_dict: Invalid `CIDCount' value\n" ));
+ FT_ERROR(( "cid_face_open: Invalid `CIDCount' value\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidload.h b/Build/source/libs/freetype2/freetype-src/src/cid/cidload.h
index 3f8bd08620a..fb9d46216d0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidload.h */
-/* */
-/* CID-keyed Type1 font loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidload.h
+ *
+ * CID-keyed Type1 font loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 CIDLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.c b/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.c
index 77afe1c8751..4e9728719b7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidobjs.c */
-/* */
-/* CID objects manager (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidobjs.c
+ *
+ * CID objects manager (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -31,21 +31,21 @@
#include "ciderrs.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cidobjs
+#define FT_COMPONENT cidobjs
- /*************************************************************************/
- /* */
- /* SLOT FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SLOT FUNCTIONS
+ *
+ */
FT_LOCAL_DEF( void )
cid_slot_done( FT_GlyphSlot slot )
@@ -85,11 +85,11 @@
}
- /*************************************************************************/
- /* */
- /* SIZE FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SIZE FUNCTIONS
+ *
+ */
static PSH_Globals_Funcs
@@ -174,23 +174,24 @@
}
- /*************************************************************************/
- /* */
- /* FACE FUNCTIONS */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cid_face_done */
- /* */
- /* <Description> */
- /* Finalizes a given face object. */
- /* */
- /* <Input> */
- /* face :: A pointer to the face object to destroy. */
- /* */
+ /**************************************************************************
+ *
+ * FACE FUNCTIONS
+ *
+ */
+
+ /**************************************************************************
+ *
+ * @Function:
+ * cid_face_done
+ *
+ * @Description:
+ * Finalizes a given face object.
+ *
+ * @Input:
+ * face ::
+ * A pointer to the face object to destroy.
+ */
FT_LOCAL_DEF( void )
cid_face_done( FT_Face cidface ) /* CID_Face */
{
@@ -252,29 +253,34 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cid_face_init */
- /* */
- /* <Description> */
- /* Initializes a given CID face object. */
- /* */
- /* <Input> */
- /* stream :: The source font stream. */
- /* */
- /* face_index :: The index of the font face in the resource. */
- /* */
- /* num_params :: Number of additional generic parameters. Ignored. */
- /* */
- /* params :: Additional generic parameters. Ignored. */
- /* */
- /* <InOut> */
- /* face :: The newly built face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cid_face_init
+ *
+ * @Description:
+ * Initializes a given CID face object.
+ *
+ * @Input:
+ * stream ::
+ * The source font stream.
+ *
+ * face_index ::
+ * The index of the font face in the resource.
+ *
+ * num_params ::
+ * Number of additional generic parameters. Ignored.
+ *
+ * params ::
+ * Additional generic parameters. Ignored.
+ *
+ * @InOut:
+ * face ::
+ * The newly built face object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
cid_face_init( FT_Stream stream,
FT_Face cidface, /* CID_Face */
@@ -449,20 +455,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cid_driver_init */
- /* */
- /* <Description> */
- /* Initializes a given CID driver object. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target driver object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cid_driver_init
+ *
+ * @Description:
+ * Initializes a given CID driver object.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target driver object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
cid_driver_init( FT_Module module )
{
@@ -505,17 +512,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cid_driver_done */
- /* */
- /* <Description> */
- /* Finalizes a given CID driver. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target CID driver. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cid_driver_done
+ *
+ * @Description:
+ * Finalizes a given CID driver.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target CID driver.
+ */
FT_LOCAL_DEF( void )
cid_driver_done( FT_Module driver )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.h b/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.h
index 0221f017dd2..89c9aa74ab8 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidobjs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidobjs.h */
-/* */
-/* CID objects manager (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidobjs.h
+ *
+ * CID objects manager (specification).
+ *
+ * Copyright (C) 1996-2019 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 CIDOBJS_H_
@@ -34,60 +34,60 @@ FT_BEGIN_HEADER
typedef struct CID_Glyph_Hints_ CID_Glyph_Hints;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CID_Driver */
- /* */
- /* <Description> */
- /* A handle to a Type 1 driver object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * CID_Driver
+ *
+ * @Description:
+ * A handle to a Type 1 driver object.
+ */
typedef struct CID_DriverRec_* CID_Driver;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CID_Size */
- /* */
- /* <Description> */
- /* A handle to a Type 1 size object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * CID_Size
+ *
+ * @Description:
+ * A handle to a Type 1 size object.
+ */
typedef struct CID_SizeRec_* CID_Size;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CID_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a Type 1 glyph slot object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * CID_GlyphSlot
+ *
+ * @Description:
+ * A handle to a Type 1 glyph slot object.
+ */
typedef struct CID_GlyphSlotRec_* CID_GlyphSlot;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CID_CharMap */
- /* */
- /* <Description> */
- /* A handle to a Type 1 character mapping object. */
- /* */
- /* <Note> */
- /* The Type 1 format doesn't use a charmap but an encoding table. */
- /* The driver is responsible for making up charmap objects */
- /* corresponding to these tables. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * CID_CharMap
+ *
+ * @Description:
+ * A handle to a Type 1 character mapping object.
+ *
+ * @Note:
+ * The Type 1 format doesn't use a charmap but an encoding table.
+ * The driver is responsible for making up charmap objects
+ * corresponding to these tables.
+ */
typedef struct CID_CharMapRec_* CID_CharMap;
- /*************************************************************************/
- /* */
- /* HERE BEGINS THE TYPE 1 SPECIFIC STUFF */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * HERE BEGINS THE TYPE 1 SPECIFIC STUFF
+ *
+ */
typedef struct CID_SizeRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.c b/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.c
index b1c7f3cb2c9..1be46ec3287 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidparse.c */
-/* */
-/* CID-keyed Type1 parser (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidparse.c
+ *
+ * CID-keyed Type1 parser (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -26,14 +26,14 @@
#include "ciderrs.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cidparse
+#define FT_COMPONENT cidparse
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.h b/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.h
index 61602f76741..ec1f6a346db 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidparse.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidparse.h */
-/* */
-/* CID-keyed Type1 parser (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidparse.h
+ *
+ * CID-keyed Type1 parser (specification).
+ *
+ * Copyright (C) 1996-2019 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 CIDPARSE_H_
@@ -29,35 +29,43 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_Parser */
- /* */
- /* <Description> */
- /* A CID_Parser is an object used to parse a Type 1 fonts very */
- /* quickly. */
- /* */
- /* <Fields> */
- /* root :: The root PS_ParserRec fields. */
- /* */
- /* stream :: The current input stream. */
- /* */
- /* postscript :: A pointer to the data to be parsed. */
- /* */
- /* postscript_len :: The length of the data to be parsed. */
- /* */
- /* data_offset :: The start position of the binary data (i.e., the */
- /* end of the data to be parsed. */
- /* */
- /* binary_length :: The length of the data after the `StartData' */
- /* command if the data format is hexadecimal. */
- /* */
- /* cid :: A structure which holds the information about */
- /* the current font. */
- /* */
- /* num_dict :: The number of font dictionaries. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * CID_Parser
+ *
+ * @Description:
+ * A CID_Parser is an object used to parse a Type 1 fonts very
+ * quickly.
+ *
+ * @Fields:
+ * root ::
+ * The root PS_ParserRec fields.
+ *
+ * stream ::
+ * The current input stream.
+ *
+ * postscript ::
+ * A pointer to the data to be parsed.
+ *
+ * postscript_len ::
+ * The length of the data to be parsed.
+ *
+ * data_offset ::
+ * The start position of the binary data (i.e., the
+ * end of the data to be parsed.
+ *
+ * binary_length ::
+ * The length of the data after the `StartData'
+ * command if the data format is hexadecimal.
+ *
+ * cid ::
+ * A structure which holds the information about
+ * the current font.
+ *
+ * num_dict ::
+ * The number of font dictionaries.
+ */
typedef struct CID_Parser_
{
PS_ParserRec root;
@@ -86,11 +94,11 @@ FT_BEGIN_HEADER
cid_parser_done( CID_Parser* parser );
- /*************************************************************************/
- /* */
- /* PARSING ROUTINES */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * PARSING ROUTINES
+ *
+ */
#define cid_parser_skip_spaces( p ) \
(p)->root.funcs.skip_spaces( &(p)->root )
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.c b/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.c
index d9faf353ea4..4d91e875291 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidriver.c */
-/* */
-/* CID driver interface (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidriver.c
+ *
+ * CID driver interface (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -34,18 +34,18 @@
#include FT_INTERNAL_POSTSCRIPT_AUX_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ciddriver
+#define FT_COMPONENT ciddriver
/*
- * POSTSCRIPT NAME SERVICE
+ * POSTSCRIPT NAME SERVICE
*
*/
@@ -69,7 +69,7 @@
/*
- * POSTSCRIPT INFO SERVICE
+ * POSTSCRIPT INFO SERVICE
*
*/
@@ -105,7 +105,7 @@
/*
- * CID INFO SERVICE
+ * CID INFO SERVICE
*
*/
static FT_Error
@@ -173,7 +173,7 @@
/*
- * PROPERTY SERVICE
+ * PROPERTY SERVICE
*
*/
@@ -185,7 +185,7 @@
/*
- * SERVICE LIST
+ * SERVICE LIST
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.h b/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.h
index 59d9ded9015..3402fd7e994 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidriver.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidriver.h */
-/* */
-/* High-level CID driver interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidriver.h
+ *
+ * High-level CID driver interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 CIDRIVER_H_
@@ -26,15 +26,9 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
-
FT_CALLBACK_TABLE
const FT_Driver_ClassRec t1cid_driver_class;
-
FT_END_HEADER
#endif /* CIDRIVER_H_ */
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidtoken.h b/Build/source/libs/freetype2/freetype-src/src/cid/cidtoken.h
index b0e2dac6aaf..f505c9e1664 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/cidtoken.h
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidtoken.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cidtoken.h */
-/* */
-/* CID token definitions (specification only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cidtoken.h
+ *
+ * CID token definitions (specification only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#undef FT_STRUCTURE
@@ -21,17 +21,20 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_CID_INFO
- T1_FIELD_KEY ( "CIDFontName", cid_font_name, 0 )
- T1_FIELD_FIXED ( "CIDFontVersion", cid_version, 0 )
- T1_FIELD_NUM ( "CIDFontType", cid_font_type, 0 )
- T1_FIELD_STRING( "Registry", registry, 0 )
- T1_FIELD_STRING( "Ordering", ordering, 0 )
- T1_FIELD_NUM ( "Supplement", supplement, 0 )
- T1_FIELD_NUM ( "UIDBase", uid_base, 0 )
- T1_FIELD_NUM ( "CIDMapOffset", cidmap_offset, 0 )
- T1_FIELD_NUM ( "FDBytes", fd_bytes, 0 )
- T1_FIELD_NUM ( "GDBytes", gd_bytes, 0 )
- T1_FIELD_NUM ( "CIDCount", cid_count, 0 )
+ T1_FIELD_KEY ( "CIDFontName", cid_font_name, 0 )
+ T1_FIELD_FIXED ( "CIDFontVersion", cid_version, 0 )
+ T1_FIELD_NUM ( "CIDFontType", cid_font_type, 0 )
+ T1_FIELD_STRING ( "Registry", registry, 0 )
+ T1_FIELD_STRING ( "Ordering", ordering, 0 )
+ T1_FIELD_NUM ( "Supplement", supplement, 0 )
+ T1_FIELD_NUM ( "UIDBase", uid_base, 0 )
+
+ T1_FIELD_NUM_TABLE( "XUID", xuid, 16, 0 )
+
+ T1_FIELD_NUM ( "CIDMapOffset", cidmap_offset, 0 )
+ T1_FIELD_NUM ( "FDBytes", fd_bytes, 0 )
+ T1_FIELD_NUM ( "GDBytes", gd_bytes, 0 )
+ T1_FIELD_NUM ( "CIDCount", cid_count, 0 )
#undef FT_STRUCTURE
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/module.mk b/Build/source/libs/freetype2/freetype-src/src/cid/module.mk
index 9010e339a46..875c683c726 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/cid/rules.mk b/Build/source/libs/freetype2/freetype-src/src/cid/rules.mk
index 94333bda06e..2b68dd48a02 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/cid/type1cid.c b/Build/source/libs/freetype2/freetype-src/src/cid/type1cid.c
index 61770e3f1e2..d21801cec19 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cid/type1cid.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cid/type1cid.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* type1cid.c */
-/* */
-/* FreeType OpenType driver component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * type1cid.c
+ *
+ * FreeType OpenType driver component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/Jamfile b/Build/source/libs/freetype2/freetype-src/src/gxvalid/Jamfile
index 74f3c51ff0e..a08e7a998d7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/gxvalid Jamfile
#
-# Copyright 2005-2018 by
+# Copyright (C) 2005-2019 by
# suzuki toshiya, Masatake YAMATO and Red Hat K.K.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/README b/Build/source/libs/freetype2/freetype-src/src/gxvalid/README
index af8128e0e79..d493587842d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/README
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/README
@@ -518,7 +518,7 @@ gxvalid: TrueType GX validator
------------------------------------------------------------------------
-Copyright 2004-2018 by
+Copyright (C) 2004-2019 by
suzuki toshiya, Masatake YAMATO, Red hat K.K.,
David Turner, Robert Wilhelm, and Werner Lemberg.
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.c
index d0577a247eb..462e461bf2a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* gxvalid.c */
-/* */
-/* FreeType validator for TrueTypeGX/AAT tables (body only). */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvalid.c
+ *
+ * FreeType validator for TrueTypeGX/AAT tables (body only).
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.h
index 19f03799822..969cd0927ab 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvalid.h
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvalid.h */
-/* */
-/* TrueTypeGX/AAT table validation (specification only). */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvalid.h
+ *
+ * TrueTypeGX/AAT table validation (specification only).
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#ifndef GXVALID_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvbsln.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvbsln.c
index c367d384834..f22f2545fa2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvbsln.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvbsln.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvbsln.c */
-/* */
-/* TrueTypeGX/AAT bsln table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvbsln.c
+ *
+ * TrueTypeGX/AAT bsln table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvbsln
+#define FT_COMPONENT gxvbsln
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.c
index b96601108b6..c5cb8ebe8b3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.c
@@ -1,41 +1,41 @@
-/***************************************************************************/
-/* */
-/* gxvcommn.c */
-/* */
-/* TrueTypeGX/AAT common tables validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvcommn.c
+ *
+ * TrueTypeGX/AAT common tables validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvcommon
+#define FT_COMPONENT gxvcommon
/*************************************************************************/
@@ -384,8 +384,8 @@
( P += 2, gxv_lookup_value_load( P - 2, SIGNSPEC ) )
static GXV_LookupValueDesc
- gxv_lookup_value_load( FT_Bytes p,
- int signspec )
+ gxv_lookup_value_load( FT_Bytes p,
+ GXV_LookupValue_SignSpec signspec )
{
GXV_LookupValueDesc v;
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.h
index 8e4ff9cafc0..334dc9dfb35 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvcommn.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* gxvcommn.h */
-/* */
-/* TrueTypeGX/AAT common tables validation (specification). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvcommn.h
+ *
+ * TrueTypeGX/AAT common tables validation (specification).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
/*
* keywords in variable naming
* ---------------------------
- * table: Of type FT_Bytes, pointing to the start of this table/subtable.
- * limit: Of type FT_Bytes, pointing to the end of this table/subtable,
+ * table: Of type FT_Bytes, pointing to the start of this table/subtable.
+ * limit: Of type FT_Bytes, pointing to the end of this table/subtable,
* including padding for alignment.
- * offset: Of type FT_UInt, the number of octets from the start to target.
- * length: Of type FT_UInt, the number of octets from the start to the
- * end in this table/subtable, including padding for alignment.
+ * offset: Of type FT_UInt, the number of octets from the start to target.
+ * length: Of type FT_UInt, the number of octets from the start to the
+ * end in this table/subtable, including padding for alignment.
*
* _MIN, _MAX: Should be added to the tail of macros, as INT_MIN, etc.
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxverror.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxverror.h
index d1151258a97..da0edb35f94 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxverror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxverror.h
@@ -1,36 +1,36 @@
-/***************************************************************************/
-/* */
-/* gxverror.h */
-/* */
-/* TrueTypeGX/AAT validation module error codes (specification only). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the OpenType validation module error */
- /* enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * gxverror.h
+ *
+ * TrueTypeGX/AAT validation module error codes (specification only).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the OpenType validation module error
+ * enumeration constants.
+ *
+ */
#ifndef GXVERROR_H_
#define GXVERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.c
index 2c805d1d119..e1a12a18edd 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvfeat.c */
-/* */
-/* TrueTypeGX/AAT feat table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvfeat.c
+ *
+ * TrueTypeGX/AAT feat table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
@@ -30,14 +30,14 @@
#include "gxvfeat.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvfeat
+#define FT_COMPONENT gxvfeat
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.h
index 2d943806c11..6c9892910ce 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfeat.h
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvfeat.h */
-/* */
-/* TrueTypeGX/AAT feat table validation (specification). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvfeat.h
+ *
+ * TrueTypeGX/AAT feat table validation (specification).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#ifndef GXVFEAT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfgen.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfgen.c
index 840c0f3524a..5ecb9443c3b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfgen.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvfgen.c
@@ -1,62 +1,62 @@
-/***************************************************************************/
-/* */
-/* gxfgen.c */
-/* */
-/* Generate feature registry data for gxv `feat' validator. */
-/* This program is derived from gxfeatreg.c in gxlayout. */
-/* */
-/* Copyright 2004-2018 by */
-/* Masatake YAMATO and Redhat K.K. */
-/* */
-/* This file 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxfgen.c
+ *
+ * Generate feature registry data for gxv `feat' validator.
+ * This program is derived from gxfeatreg.c in gxlayout.
+ *
+ * Copyright (C) 2004-2019 by
+ * Masatake YAMATO and Redhat K.K.
+ *
+ * This file 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.
+ *
+ */
-/***************************************************************************/
-/* */
-/* gxfeatreg.c */
-/* */
-/* Database of font features pre-defined by Apple Computer, Inc. */
-/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html */
-/* (body). */
-/* */
-/* Copyright 2003 by */
-/* Masatake YAMATO and Redhat K.K. */
-/* */
-/* This file 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxfeatreg.c
+ *
+ * Database of font features pre-defined by Apple Computer, Inc.
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html
+ * (body).
+ *
+ * Copyright 2003 by
+ * Masatake YAMATO and Redhat K.K.
+ *
+ * This file may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
-/***************************************************************************/
-/* */
-/* Development of gxfeatreg.c is supported by */
-/* Information-technology Promotion Agency, Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * Development of gxfeatreg.c is supported by
+ * Information-technology Promotion Agency, Japan.
+ *
+ */
-/***************************************************************************/
-/* */
-/* This file is compiled as a stand-alone executable. */
-/* This file is never compiled into `libfreetype2'. */
-/* The output of this file is used in `gxvfeat.c'. */
-/* ----------------------------------------------------------------------- */
-/* Compile: gcc `pkg-config --cflags freetype2` gxvfgen.c -o gxvfgen */
-/* Run: ./gxvfgen > tmp.c */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * This file is compiled as a stand-alone executable.
+ * This file is never compiled into `libfreetype2'.
+ * The output of this file is used in `gxvfeat.c'.
+ * -----------------------------------------------------------------------
+ * Compile: gcc `pkg-config --cflags freetype2` gxvfgen.c -o gxvfgen
+ * Run: ./gxvfgen > tmp.c
+ *
+ */
- /*******************************************************************/
- /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */
- /*******************************************************************/
+ /********************************************************************
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ */
/*
* If you add a new setting to a feature, check the number of settings
@@ -65,9 +65,9 @@
*/
#define FEATREG_MAX_SETTING 12
- /*******************************************************************/
- /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */
- /*******************************************************************/
+ /********************************************************************
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ */
#include <stdio.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvjust.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvjust.c
index 00c4293195b..a582377859f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvjust.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvjust.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvjust.c */
-/* */
-/* TrueTypeGX/AAT just table validation (body). */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvjust.c
+ *
+ * TrueTypeGX/AAT just table validation (body).
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
@@ -31,14 +31,14 @@
#include FT_SFNT_NAMES_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvjust
+#define FT_COMPONENT gxvjust
/*
* referred `just' table format specification:
@@ -72,6 +72,8 @@
const FT_String* msg_tag,
GXV_Validator gxvalid )
{
+ FT_UNUSED( msg_tag );
+
if ( gid < gxvalid->face->num_glyphs )
return;
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvkern.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvkern.c
index 9c0efd7a4f6..a7532335a57 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvkern.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvkern.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvkern.c */
-/* */
-/* TrueTypeGX/AAT kern table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvkern.c
+ *
+ * TrueTypeGX/AAT kern table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
@@ -32,14 +32,14 @@
#include FT_SERVICE_GX_VALIDATE_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvkern
+#define FT_COMPONENT gxvkern
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvlcar.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvlcar.c
index 0f261a9ace3..13b3de3eaa8 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvlcar.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvlcar.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvlcar.c */
-/* */
-/* TrueTypeGX/AAT lcar table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvlcar.c
+ *
+ * TrueTypeGX/AAT lcar table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvlcar
+#define FT_COMPONENT gxvlcar
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.c
index 1a3c862927d..eeadeb3e1d6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvmod.c */
-/* */
-/* FreeType's TrueTypeGX/AAT validation module implementation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmod.c
+ *
+ * FreeType's TrueTypeGX/AAT validation module implementation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include <ft2build.h>
@@ -37,14 +37,14 @@
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmodule
+#define FT_COMPONENT gxvmodule
static FT_Error
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.h
index 745c62e1054..6ecd7312c9f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmod.h
@@ -1,29 +1,29 @@
-/***************************************************************************/
-/* */
-/* gxvmod.h */
-/* */
-/* FreeType's TrueTypeGX/AAT validation module implementation */
-/* (specification). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmod.h
+ *
+ * FreeType's TrueTypeGX/AAT validation module implementation
+ * (specification).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#ifndef GXVMOD_H_
@@ -35,10 +35,6 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
FT_EXPORT_VAR( const FT_Module_Class ) gxv_module_class;
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.c
index b361cb2b9d7..288ef6988b7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmort.c */
-/* */
-/* TrueTypeGX/AAT mort table validation (body). */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort.c
+ *
+ * TrueTypeGX/AAT mort table validation (body).
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmort.h"
#include "gxvfeat.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmort
+#define FT_COMPONENT gxvmort
static void
@@ -123,6 +123,7 @@
GXV_Validator gxvalid )
{
FT_UNUSED( gxvalid );
+ FT_UNUSED( coverage );
#ifdef FT_DEBUG_LEVEL_TRACE
if ( coverage & 0x8000U )
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.h
index d8030645e99..0619e24fb9d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort.h
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvmort.h */
-/* */
-/* TrueTypeGX/AAT common definition for mort table (specification). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort.h
+ *
+ * TrueTypeGX/AAT common definition for mort table (specification).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#ifndef GXVMORT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort0.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort0.c
index 95cf53d5ebf..2c01bf95ec7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort0.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort0.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmort0.c */
-/* */
-/* TrueTypeGX/AAT mort table validation */
-/* body for type0 (Indic Script Rearrangement) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort0.c
+ *
+ * TrueTypeGX/AAT mort table validation
+ * body for type0 (Indic Script Rearrangement) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmort.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmort
+#define FT_COMPONENT gxvmort
static const char* GXV_Mort_IndicScript_Msg[] =
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort1.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort1.c
index a7683a17b0b..c71ba13351c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort1.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort1.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmort1.c */
-/* */
-/* TrueTypeGX/AAT mort table validation */
-/* body for type1 (Contextual Substitution) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort1.c
+ *
+ * TrueTypeGX/AAT mort table validation
+ * body for type1 (Contextual Substitution) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmort.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmort
+#define FT_COMPONENT gxvmort
typedef struct GXV_mort_subtable_type1_StateOptRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort2.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort2.c
index c23c2775a15..889d3bd582c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort2.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort2.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmort2.c */
-/* */
-/* TrueTypeGX/AAT mort table validation */
-/* body for type2 (Ligature Substitution) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort2.c
+ *
+ * TrueTypeGX/AAT mort table validation
+ * body for type2 (Ligature Substitution) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmort.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmort
+#define FT_COMPONENT gxvmort
typedef struct GXV_mort_subtable_type2_StateOptRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort4.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort4.c
index 9d21a5fc29d..f8ce6cf789e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort4.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort4.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmort4.c */
-/* */
-/* TrueTypeGX/AAT mort table validation */
-/* body for type4 (Non-Contextual Glyph Substitution) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort4.c
+ *
+ * TrueTypeGX/AAT mort table validation
+ * body for type4 (Non-Contextual Glyph Substitution) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmort.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmort
+#define FT_COMPONENT gxvmort
static void
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort5.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort5.c
index 42cb428aa88..1ba1e5ded05 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort5.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmort5.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmort5.c */
-/* */
-/* TrueTypeGX/AAT mort table validation */
-/* body for type5 (Contextual Glyph Insertion) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmort5.c
+ *
+ * TrueTypeGX/AAT mort table validation
+ * body for type5 (Contextual Glyph Insertion) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmort.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmort
+#define FT_COMPONENT gxvmort
/*
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.c
index 9fd6e6b971e..8bd45c27e6b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.c
@@ -1,41 +1,41 @@
-/***************************************************************************/
-/* */
-/* gxvmorx.c */
-/* */
-/* TrueTypeGX/AAT morx table validation (body). */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx.c
+ *
+ * TrueTypeGX/AAT morx table validation (body).
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmorx.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmorx
+#define FT_COMPONENT gxvmorx
static void
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.h b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.h
index 6d9925e92b2..e2572703424 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.h
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx.h
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* gxvmorx.h */
-/* */
-/* TrueTypeGX/AAT common definition for morx table (specification). */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx.h
+ *
+ * TrueTypeGX/AAT common definition for morx table (specification).
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#ifndef GXVMORX_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx0.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx0.c
index 302261b7fa2..d7764a0ae8b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx0.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx0.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmorx0.c */
-/* */
-/* TrueTypeGX/AAT morx table validation */
-/* body for type0 (Indic Script Rearrangement) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx0.c
+ *
+ * TrueTypeGX/AAT morx table validation
+ * body for type0 (Indic Script Rearrangement) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmorx.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmorx
+#define FT_COMPONENT gxvmorx
static void
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx1.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx1.c
index 890ca74b1d1..5b41b3605f8 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx1.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx1.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmorx1.c */
-/* */
-/* TrueTypeGX/AAT morx table validation */
-/* body for type1 (Contextual Substitution) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx1.c
+ *
+ * TrueTypeGX/AAT morx table validation
+ * body for type1 (Contextual Substitution) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmorx.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmorx
+#define FT_COMPONENT gxvmorx
typedef struct GXV_morx_subtable_type1_StateOptRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx2.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx2.c
index 3135031d457..ec4c81299d6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx2.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx2.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmorx2.c */
-/* */
-/* TrueTypeGX/AAT morx table validation */
-/* body for type2 (Ligature Substitution) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx2.c
+ *
+ * TrueTypeGX/AAT morx table validation
+ * body for type2 (Ligature Substitution) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmorx.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmorx
+#define FT_COMPONENT gxvmorx
typedef struct GXV_morx_subtable_type2_StateOptRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx4.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx4.c
index 1e2397b0c57..7b041534c0b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx4.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx4.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmorx4.c */
-/* */
-/* TrueTypeGX/AAT morx table validation */
-/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx4.c
+ *
+ * TrueTypeGX/AAT morx table validation
+ * body for "morx" type4 (Non-Contextual Glyph Substitution) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmorx.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmorx
+#define FT_COMPONENT gxvmorx
FT_LOCAL_DEF( void )
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx5.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx5.c
index db4f9290c8e..70a46236565 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx5.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvmorx5.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvmorx5.c */
-/* */
-/* TrueTypeGX/AAT morx table validation */
-/* body for type5 (Contextual Glyph Insertion) subtable. */
-/* */
-/* Copyright 2005-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvmorx5.c
+ *
+ * TrueTypeGX/AAT morx table validation
+ * body for type5 (Contextual Glyph Insertion) subtable.
+ *
+ * Copyright (C) 2005-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvmorx.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvmorx
+#define FT_COMPONENT gxvmorx
/*
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvopbd.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvopbd.c
index e2c167ea599..f055a220544 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvopbd.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvopbd.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvopbd.c */
-/* */
-/* TrueTypeGX/AAT opbd table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvopbd.c
+ *
+ * TrueTypeGX/AAT opbd table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvopbd
+#define FT_COMPONENT gxvopbd
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvprop.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvprop.c
index a67b6bdd009..e1911edd48d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvprop.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvprop.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvprop.c */
-/* */
-/* TrueTypeGX/AAT prop table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvprop.c
+ *
+ * TrueTypeGX/AAT prop table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvprop
+#define FT_COMPONENT gxvprop
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvtrak.c b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvtrak.c
index d501b5014b5..b7794b7af46 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvtrak.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/gxvtrak.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* gxvtrak.c */
-/* */
-/* TrueTypeGX/AAT trak table validation (body). */
-/* */
-/* Copyright 2004-2018 by */
-/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
-/* 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. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * gxvtrak.c
+ *
+ * TrueTypeGX/AAT trak table validation (body).
+ *
+ * Copyright (C) 2004-2019 by
+ * suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
+ *
+ */
#include "gxvalid.h"
#include "gxvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_gxvtrak
+#define FT_COMPONENT gxvtrak
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/module.mk b/Build/source/libs/freetype2/freetype-src/src/gxvalid/module.mk
index b64879dcee7..04067ce6178 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/module.mk
@@ -2,7 +2,7 @@
# FreeType 2 gxvalid module definition
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/Build/source/libs/freetype2/freetype-src/src/gxvalid/rules.mk b/Build/source/libs/freetype2/freetype-src/src/gxvalid/rules.mk
index 3a17c030a60..4ef463bc21d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gxvalid/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/gxvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/Build/source/libs/freetype2/freetype-src/src/gzip/Jamfile b/Build/source/libs/freetype2/freetype-src/src/gzip/Jamfile
index a7b4c8c9506..2c808b74a53 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gzip/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/gzip/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/gzip Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c b/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c
index f8011c2dd82..a5206307f4e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c
+++ b/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c
@@ -1,23 +1,23 @@
-/***************************************************************************/
-/* */
-/* ftgzip.c */
-/* */
-/* FreeType support for .gz compressed files. */
-/* */
-/* This optional component relies on zlib. It should mainly be used to */
-/* parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgzip.c
+ *
+ * FreeType support for .gz compressed files.
+ *
+ * This optional component relies on zlib. It should mainly be used to
+ * parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -41,10 +41,6 @@
#ifdef FT_CONFIG_OPTION_USE_ZLIB
-#ifdef FT_CONFIG_OPTION_PIC
-#error "gzip code does not support PIC yet"
-#endif
-
#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
#include <zlib.h>
@@ -637,8 +633,8 @@
memory = source->memory;
/*
- * check the header right now; this prevents allocating un-necessary
- * objects when we don't need them
+ * check the header right now; this prevents allocating un-necessary
+ * objects when we don't need them
*/
error = ft_gzip_check_header( source );
if ( error )
@@ -660,12 +656,12 @@
}
/*
- * We use the following trick to try to dramatically improve the
- * performance while dealing with small files. If the original stream
- * size is less than a certain threshold, we try to load the whole font
- * file into memory. This saves us from using the 32KB buffer needed
- * to inflate the file, plus the two 4KB intermediate input/output
- * buffers used in the `FT_GZipFile' structure.
+ * We use the following trick to try to dramatically improve the
+ * performance while dealing with small files. If the original stream
+ * size is less than a certain threshold, we try to load the whole font
+ * file into memory. This saves us from using the 32KB buffer needed
+ * to inflate the file, plus the two 4KB intermediate input/output
+ * buffers used in the `FT_GZipFile' structure.
*/
{
FT_ULong zip_size = ft_gzip_get_uncompressed_size( source );
@@ -735,7 +731,7 @@
/* check for `input' delayed to `inflate' */
- if ( !memory || ! output_len || !output )
+ if ( !memory || !output_len || !output )
return FT_THROW( Invalid_Argument );
/* this function is modeled after zlib's `uncompress' function */
diff --git a/Build/source/libs/freetype2/freetype-src/src/gzip/rules.mk b/Build/source/libs/freetype2/freetype-src/src/gzip/rules.mk
index 1a2e48bebd9..44206a1daed 100644
--- a/Build/source/libs/freetype2/freetype-src/src/gzip/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/gzip/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/lzw/Jamfile b/Build/source/libs/freetype2/freetype-src/src/lzw/Jamfile
index cb83aa4a562..ba2d6ebb456 100644
--- a/Build/source/libs/freetype2/freetype-src/src/lzw/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/lzw/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/lzw Jamfile
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 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/Build/source/libs/freetype2/freetype-src/src/lzw/ftlzw.c b/Build/source/libs/freetype2/freetype-src/src/lzw/ftlzw.c
index cb46f93c68e..9805a1e3bd0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/lzw/ftlzw.c
+++ b/Build/source/libs/freetype2/freetype-src/src/lzw/ftlzw.c
@@ -1,25 +1,25 @@
-/***************************************************************************/
-/* */
-/* ftlzw.c */
-/* */
-/* FreeType support for .Z compressed files. */
-/* */
-/* This optional component relies on NetBSD's zopen(). It should mainly */
-/* be used to parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2004-2018 by */
-/* Albert Chin-A-Young. */
-/* */
-/* based on code in `src/gzip/ftgzip.c' */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftlzw.c
+ *
+ * FreeType support for .Z compressed files.
+ *
+ * This optional component relies on NetBSD's zopen(). It should mainly
+ * be used to parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2004-2019 by
+ * Albert Chin-A-Young.
+ *
+ * based on code in `src/gzip/ftgzip.c'
+ *
+ * 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 <ft2build.h>
#include FT_INTERNAL_MEMORY_H
@@ -42,10 +42,6 @@
#ifdef FT_CONFIG_OPTION_USE_LZW
-#ifdef FT_CONFIG_OPTION_PIC
-#error "lzw code does not support PIC yet"
-#endif
-
#include "ftzopen.h"
@@ -361,11 +357,11 @@
memory = source->memory;
/*
- * Check the header right now; this prevents allocation of a huge
- * LZWFile object (400 KByte of heap memory) if not necessary.
+ * Check the header right now; this prevents allocation of a huge
+ * LZWFile object (400 KByte of heap memory) if not necessary.
*
- * Did I mention that you should never use .Z compressed font
- * files?
+ * Did I mention that you should never use .Z compressed font
+ * files?
*/
error = ft_lzw_check_header( source );
if ( error )
diff --git a/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.c b/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.c
index 2b868ba9f2d..67e6760f95f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.c
+++ b/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.c
@@ -1,23 +1,23 @@
-/***************************************************************************/
-/* */
-/* ftzopen.c */
-/* */
-/* FreeType support for .Z compressed files. */
-/* */
-/* This optional component relies on NetBSD's zopen(). It should mainly */
-/* be used to parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2005-2018 by */
-/* David Turner. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftzopen.c
+ *
+ * FreeType support for .Z compressed files.
+ *
+ * This optional component relies on NetBSD's zopen(). It should mainly
+ * be used to parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2005-2019 by
+ * David Turner.
+ *
+ * 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 "ftzopen.h"
#include FT_INTERNAL_MEMORY_H
@@ -167,11 +167,11 @@
new_size += new_size >> 2; /* don't grow too fast */
/*
- * Note that the `suffix' array is located in the same memory block
- * pointed to by `prefix'.
+ * Note that the `suffix' array is located in the same memory block
+ * pointed to by `prefix'.
*
- * I know that sizeof(FT_Byte) == 1 by definition, but it is clearer
- * to write it literally.
+ * I know that sizeof(FT_Byte) == 1 by definition, but it is clearer
+ * to write it literally.
*
*/
if ( FT_REALLOC_MULT( state->prefix, old_size, new_size,
diff --git a/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.h b/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.h
index 4fd267eb90f..44fe36d6c5b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.h
+++ b/Build/source/libs/freetype2/freetype-src/src/lzw/ftzopen.h
@@ -1,23 +1,23 @@
-/***************************************************************************/
-/* */
-/* ftzopen.h */
-/* */
-/* FreeType support for .Z compressed files. */
-/* */
-/* This optional component relies on NetBSD's zopen(). It should mainly */
-/* be used to parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2005-2018 by */
-/* David Turner. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftzopen.h
+ *
+ * FreeType support for .Z compressed files.
+ *
+ * This optional component relies on NetBSD's zopen(). It should mainly
+ * be used to parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2005-2019 by
+ * David Turner.
+ *
+ * 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 FTZOPEN_H_
#define FTZOPEN_H_
@@ -27,9 +27,9 @@
/*
- * This is a complete re-implementation of the LZW file reader,
- * since the old one was incredibly badly written, using
- * 400 KByte of heap memory before decompressing anything.
+ * This is a complete re-implementation of the LZW file reader,
+ * since the old one was incredibly badly written, using
+ * 400 KByte of heap memory before decompressing anything.
*
*/
@@ -58,56 +58,56 @@
/*
- * state of LZW decompressor
+ * state of LZW decompressor
*
- * small technical note
- * --------------------
+ * small technical note
+ * --------------------
*
- * We use a few tricks in this implementation that are explained here to
- * ease debugging and maintenance.
+ * We use a few tricks in this implementation that are explained here to
+ * ease debugging and maintenance.
*
- * - First of all, the `prefix' and `suffix' arrays contain the suffix
- * and prefix for codes over 256; this means that
+ * - First of all, the `prefix' and `suffix' arrays contain the suffix
+ * and prefix for codes over 256; this means that
*
- * prefix_of(code) == state->prefix[code-256]
- * suffix_of(code) == state->suffix[code-256]
+ * prefix_of(code) == state->prefix[code-256]
+ * suffix_of(code) == state->suffix[code-256]
*
- * Each prefix is a 16-bit code, and each suffix an 8-bit byte.
+ * Each prefix is a 16-bit code, and each suffix an 8-bit byte.
*
- * Both arrays are stored in a single memory block, pointed to by
- * `state->prefix'. This means that the following equality is always
- * true:
+ * Both arrays are stored in a single memory block, pointed to by
+ * `state->prefix'. This means that the following equality is always
+ * true:
*
- * state->suffix == (FT_Byte*)(state->prefix + state->prefix_size)
+ * state->suffix == (FT_Byte*)(state->prefix + state->prefix_size)
*
- * Of course, state->prefix_size is the number of prefix/suffix slots
- * in the arrays, corresponding to codes 256..255+prefix_size.
+ * Of course, state->prefix_size is the number of prefix/suffix slots
+ * in the arrays, corresponding to codes 256..255+prefix_size.
*
- * - `free_ent' is the index of the next free entry in the `prefix'
- * and `suffix' arrays. This means that the corresponding `next free
- * code' is really `256+free_ent'.
+ * - `free_ent' is the index of the next free entry in the `prefix'
+ * and `suffix' arrays. This means that the corresponding `next free
+ * code' is really `256+free_ent'.
*
- * Moreover, `max_free' is the maximum value that `free_ent' can reach.
+ * Moreover, `max_free' is the maximum value that `free_ent' can reach.
*
- * `max_free' corresponds to `(1 << max_bits) - 256'. Note that this
- * value is always <= 0xFF00, which means that both `free_ent' and
- * `max_free' can be stored in an FT_UInt variable, even on 16-bit
- * machines.
+ * `max_free' corresponds to `(1 << max_bits) - 256'. Note that this
+ * value is always <= 0xFF00, which means that both `free_ent' and
+ * `max_free' can be stored in an FT_UInt variable, even on 16-bit
+ * machines.
*
- * If `free_ent == max_free', you cannot add new codes to the
- * prefix/suffix table.
+ * If `free_ent == max_free', you cannot add new codes to the
+ * prefix/suffix table.
*
- * - `num_bits' is the current number of code bits, starting at 9 and
- * growing each time `free_ent' reaches the value of `free_bits'. The
- * latter is computed as follows
+ * - `num_bits' is the current number of code bits, starting at 9 and
+ * growing each time `free_ent' reaches the value of `free_bits'. The
+ * latter is computed as follows
*
- * if num_bits < max_bits:
- * free_bits = (1 << num_bits)-256
- * else:
- * free_bits = max_free + 1
+ * if num_bits < max_bits:
+ * free_bits = (1 << num_bits)-256
+ * else:
+ * free_bits = max_free + 1
*
- * Since the value of `max_free + 1' can never be reached by
- * `free_ent', `num_bits' cannot grow larger than `max_bits'.
+ * Since the value of `max_free + 1' can never be reached by
+ * `free_ent', `num_bits' cannot grow larger than `max_bits'.
*/
typedef struct FT_LzwStateRec_
diff --git a/Build/source/libs/freetype2/freetype-src/src/lzw/rules.mk b/Build/source/libs/freetype2/freetype-src/src/lzw/rules.mk
index 18933c41c2e..930b32e6b10 100644
--- a/Build/source/libs/freetype2/freetype-src/src/lzw/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/lzw/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 by
# Albert Chin-A-Young.
#
# based on `src/lzw/rules.mk'
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/Jamfile b/Build/source/libs/freetype2/freetype-src/src/otvalid/Jamfile
index 21b8e0cb0f6..36db0e1f838 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/otvalid Jamfile
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 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/Build/source/libs/freetype2/freetype-src/src/otvalid/module.mk b/Build/source/libs/freetype2/freetype-src/src/otvalid/module.mk
index 34f3dab32f0..5ea5b7b57b7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 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/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.c
index 4423ca10128..e3964b99aee 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvalid.c */
-/* */
-/* FreeType validator for OpenType tables (body only). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvalid.c
+ *
+ * FreeType validator for OpenType tables (body only).
+ *
+ * Copyright (C) 2004-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.h b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.h
index d7801abae50..5ca819f2619 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.h
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvalid.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvalid.h */
-/* */
-/* OpenType table validation (specification only). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvalid.h
+ *
+ * OpenType table validation (specification only).
+ *
+ * Copyright (C) 2004-2019 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 OTVALID_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvbase.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvbase.c
index a01d45c707a..be69d7ca31d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvbase.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvbase.c
@@ -1,33 +1,33 @@
-/***************************************************************************/
-/* */
-/* otvbase.c */
-/* */
-/* OpenType BASE table validation (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvbase.c
+ *
+ * OpenType BASE table validation (body).
+ *
+ * Copyright (C) 2004-2019 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 "otvalid.h"
#include "otvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvbase
+#define FT_COMPONENT otvbase
static void
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.c
index 0ccfb03c08a..5ed1723506f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.c
@@ -1,32 +1,32 @@
-/***************************************************************************/
-/* */
-/* otvcommn.c */
-/* */
-/* OpenType common tables validation (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvcommn.c
+ *
+ * OpenType common tables validation (body).
+ *
+ * Copyright (C) 2004-2019 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 "otvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvcommon
+#define FT_COMPONENT otvcommon
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.h b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.h
index a392784cf19..bfcc5b974a3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.h
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvcommn.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvcommn.h */
-/* */
-/* OpenType common tables validation (specification). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvcommn.h
+ *
+ * OpenType common tables validation (specification).
+ *
+ * Copyright (C) 2004-2019 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 OTVCOMMN_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otverror.h b/Build/source/libs/freetype2/freetype-src/src/otvalid/otverror.h
index 2fcf42e3875..a7d35acf1ab 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otverror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otverror.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* otverror.h */
-/* */
-/* OpenType validation module error codes (specification only). */
-/* */
-/* Copyright 2004-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the OpenType validation module error */
- /* enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * otverror.h
+ *
+ * OpenType validation module error codes (specification only).
+ *
+ * Copyright (C) 2004-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the OpenType validation module error
+ * enumeration constants.
+ *
+ */
#ifndef OTVERROR_H_
#define OTVERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgdef.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgdef.c
index 08f3171541f..2529b544d2a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgdef.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgdef.c
@@ -1,33 +1,33 @@
-/***************************************************************************/
-/* */
-/* otvgdef.c */
-/* */
-/* OpenType GDEF table validation (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvgdef.c
+ *
+ * OpenType GDEF table validation (body).
+ *
+ * Copyright (C) 2004-2019 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 "otvalid.h"
#include "otvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvgdef
+#define FT_COMPONENT otvgdef
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.c
index 696b35cae62..f3bddeac6cc 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvgpos.c */
-/* */
-/* OpenType GPOS table validation (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvgpos.c
+ *
+ * OpenType GPOS table validation (body).
+ *
+ * Copyright (C) 2002-2019 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 "otvalid.h"
@@ -21,14 +21,14 @@
#include "otvgpos.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvgpos
+#define FT_COMPONENT otvgpos
static void
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.h b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.h
index 95f9ac3ee85..b3154312eb1 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.h
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgpos.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvgpos.h */
-/* */
-/* OpenType GPOS table validator (specification). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvgpos.h
+ *
+ * OpenType GPOS table validator (specification).
+ *
+ * Copyright (C) 2004-2019 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 OTVGPOS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgsub.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgsub.c
index d35ea67f309..97da997d3da 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgsub.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvgsub.c
@@ -1,33 +1,33 @@
-/***************************************************************************/
-/* */
-/* otvgsub.c */
-/* */
-/* OpenType GSUB table validation (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvgsub.c
+ *
+ * OpenType GSUB table validation (body).
+ *
+ * Copyright (C) 2004-2019 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 "otvalid.h"
#include "otvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvgsub
+#define FT_COMPONENT otvgsub
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvjstf.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvjstf.c
index 94d4af90f6f..d4e6d871787 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvjstf.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvjstf.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvjstf.c */
-/* */
-/* OpenType JSTF table validation (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvjstf.c
+ *
+ * OpenType JSTF table validation (body).
+ *
+ * Copyright (C) 2004-2019 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 "otvalid.h"
@@ -21,14 +21,14 @@
#include "otvgpos.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvjstf
+#define FT_COMPONENT otvjstf
#define JstfPriorityFunc otv_JstfPriority_validate
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmath.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmath.c
index b9800f60a26..3aaf0ec0ec5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmath.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmath.c
@@ -1,21 +1,21 @@
-/***************************************************************************/
-/* */
-/* otvmath.c */
-/* */
-/* OpenType MATH table validation (body). */
-/* */
-/* Copyright 2007-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* Written by George Williams. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvmath.c
+ *
+ * OpenType MATH table validation (body).
+ *
+ * Copyright (C) 2007-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * Written by George Williams.
+ *
+ * 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 "otvalid.h"
@@ -23,14 +23,14 @@
#include "otvgpos.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvmath
+#define FT_COMPONENT otvmath
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.c b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.c
index 89ee449d16d..f417bd220f5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.c
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* otvmod.c */
-/* */
-/* FreeType's OpenType validation module implementation (body). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvmod.c
+ *
+ * FreeType's OpenType validation module implementation (body).
+ *
+ * Copyright (C) 2004-2019 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 <ft2build.h>
@@ -28,14 +28,14 @@
#include "otvcommn.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_otvmodule
+#define FT_COMPONENT otvmodule
static FT_Error
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.h b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.h
index 6917bccee5d..5539de7ec6e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.h
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/otvmod.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* otvmod.h */
-/* */
-/* FreeType's OpenType validation module implementation */
-/* (specification). */
-/* */
-/* Copyright 2004-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * otvmod.h
+ *
+ * FreeType's OpenType validation module implementation
+ * (specification).
+ *
+ * Copyright (C) 2004-2019 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 OTVMOD_H_
@@ -27,10 +27,6 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class;
diff --git a/Build/source/libs/freetype2/freetype-src/src/otvalid/rules.mk b/Build/source/libs/freetype2/freetype-src/src/otvalid/rules.mk
index d4fc7237405..3c6ece1c190 100644
--- a/Build/source/libs/freetype2/freetype-src/src/otvalid/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/otvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2018 by
+# Copyright (C) 2004-2019 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/Build/source/libs/freetype2/freetype-src/src/pcf/Jamfile b/Build/source/libs/freetype2/freetype-src/src/pcf/Jamfile
index 7b92b12ddcf..fd17d53f0dd 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/pcf Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/pcf/pcf.h b/Build/source/libs/freetype2/freetype-src/src/pcf/pcf.h
index f0390cb1eb3..529dd3adf86 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcf.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcf.h
@@ -104,6 +104,19 @@ FT_BEGIN_HEADER
} PCF_MetricRec, *PCF_Metric;
+ typedef struct PCF_EncRec_
+ {
+ FT_UShort firstCol;
+ FT_UShort lastCol;
+ FT_UShort firstRow;
+ FT_UShort lastRow;
+ FT_UShort defaultChar;
+
+ FT_UShort* offset;
+
+ } PCF_EncRec, *PCF_Enc;
+
+
typedef struct PCF_AccelRec_
{
FT_Byte noOverlap;
@@ -124,41 +137,32 @@ FT_BEGIN_HEADER
} PCF_AccelRec, *PCF_Accel;
- typedef struct PCF_EncodingRec_
- {
- FT_Long enc;
- FT_UShort glyph;
-
- } PCF_EncodingRec, *PCF_Encoding;
-
-
+ /*
+ * This file uses X11 terminology for PCF data; an `encoding' in X11 speak
+ * is the same as a `character code' in FreeType speak.
+ */
typedef struct PCF_FaceRec_
{
- FT_FaceRec root;
-
- FT_StreamRec comp_stream;
- FT_Stream comp_source;
+ FT_FaceRec root;
- char* charset_encoding;
- char* charset_registry;
+ FT_StreamRec comp_stream;
+ FT_Stream comp_source;
- PCF_TocRec toc;
- PCF_AccelRec accel;
+ char* charset_encoding;
+ char* charset_registry;
- int nprops;
- PCF_Property properties;
+ PCF_TocRec toc;
+ PCF_AccelRec accel;
- FT_ULong nmetrics;
- PCF_Metric metrics;
- FT_ULong nencodings;
- PCF_Encoding encodings;
+ int nprops;
+ PCF_Property properties;
- FT_Short defaultChar;
+ FT_ULong nmetrics;
+ PCF_Metric metrics;
- FT_ULong bitmapsFormat;
+ PCF_EncRec enc;
- FT_CharMap charmap_handle;
- FT_CharMapRec charmap; /* a single charmap per face */
+ FT_ULong bitmapsFormat;
} PCF_FaceRec, *PCF_Face;
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c
index 0119d94853a..54bbb9d119c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c
@@ -45,7 +45,7 @@ THE SOFTWARE.
#include "pcfutil.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pcfread
+#define FT_COMPONENT pcfread
#include FT_SERVICE_BDF_H
#include FT_SERVICE_FONT_FORMAT_H
@@ -53,21 +53,24 @@ THE SOFTWARE.
#include FT_DRIVER_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_pcfdriver
+#define FT_COMPONENT pcfdriver
+ /*
+ * This file uses X11 terminology for PCF data; an `encoding' in X11 speak
+ * is the same as a `character code' in FreeType speak.
+ */
typedef struct PCF_CMapRec_
{
- FT_CMapRec root;
- FT_ULong num_encodings;
- PCF_Encoding encodings;
+ FT_CMapRec root;
+ PCF_Enc enc;
} PCF_CMapRec, *PCF_CMap;
@@ -82,8 +85,7 @@ THE SOFTWARE.
FT_UNUSED( init_data );
- cmap->num_encodings = face->nencodings;
- cmap->encodings = face->encodings;
+ cmap->enc = &face->enc;
return FT_Err_Ok;
}
@@ -95,8 +97,7 @@ THE SOFTWARE.
PCF_CMap cmap = (PCF_CMap)pcfcmap;
- cmap->encodings = NULL;
- cmap->num_encodings = 0;
+ cmap->enc = NULL;
}
@@ -104,36 +105,26 @@ THE SOFTWARE.
pcf_cmap_char_index( FT_CMap pcfcmap, /* PCF_CMap */
FT_UInt32 charcode )
{
- PCF_CMap cmap = (PCF_CMap)pcfcmap;
- PCF_Encoding encodings = cmap->encodings;
- FT_ULong min, max, mid;
- FT_UInt result = 0;
+ PCF_CMap cmap = (PCF_CMap)pcfcmap;
+ PCF_Enc enc = cmap->enc;
+ FT_UShort charcodeRow;
+ FT_UShort charcodeCol;
- min = 0;
- max = cmap->num_encodings;
+ if ( charcode > (FT_UInt32)( enc->lastRow * 256 + enc->lastCol ) ||
+ charcode < (FT_UInt32)( enc->firstRow * 256 + enc->firstCol ) )
+ return 0;
- while ( min < max )
- {
- FT_ULong code;
+ charcodeRow = (FT_UShort)( charcode >> 8 );
+ charcodeCol = (FT_UShort)( charcode & 0xFF );
+ if ( charcodeCol < enc->firstCol ||
+ charcodeCol > enc->lastCol )
+ return 0;
- mid = ( min + max ) >> 1;
- code = (FT_ULong)encodings[mid].enc;
-
- if ( charcode == code )
- {
- result = encodings[mid].glyph + 1;
- break;
- }
-
- if ( charcode < code )
- max = mid;
- else
- min = mid + 1;
- }
-
- return result;
+ return (FT_UInt)enc->offset[ ( charcodeRow - enc->firstRow ) *
+ ( enc->lastCol - enc->firstCol + 1 ) +
+ charcodeCol - enc->firstCol ];
}
@@ -141,52 +132,43 @@ THE SOFTWARE.
pcf_cmap_char_next( FT_CMap pcfcmap, /* PCF_CMap */
FT_UInt32 *acharcode )
{
- PCF_CMap cmap = (PCF_CMap)pcfcmap;
- PCF_Encoding encodings = cmap->encodings;
- FT_ULong min, max, mid;
- FT_ULong charcode = *acharcode + 1;
- FT_UInt result = 0;
-
+ PCF_CMap cmap = (PCF_CMap)pcfcmap;
+ PCF_Enc enc = cmap->enc;
+ FT_UInt32 charcode = *acharcode;
+ FT_UShort charcodeRow;
+ FT_UShort charcodeCol;
+ FT_Int result = 0;
- min = 0;
- max = cmap->num_encodings;
- while ( min < max )
+ while ( charcode < (FT_UInt32)( enc->lastRow * 256 + enc->lastCol ) )
{
- FT_ULong code;
+ charcode++;
+ if ( charcode < (FT_UInt32)( enc->firstRow * 256 + enc->firstCol ) )
+ charcode = (FT_UInt32)( enc->firstRow * 256 + enc->firstCol );
- mid = ( min + max ) >> 1;
- code = (FT_ULong)encodings[mid].enc;
+ charcodeRow = (FT_UShort)( charcode >> 8 );
+ charcodeCol = (FT_UShort)( charcode & 0xFF );
- if ( charcode == code )
+ if ( charcodeCol < enc->firstCol )
+ charcodeCol = enc->firstCol;
+ else if ( charcodeCol > enc->lastCol )
{
- result = encodings[mid].glyph + 1;
- goto Exit;
+ charcodeRow++;
+ charcodeCol = enc->firstCol;
}
- if ( charcode < code )
- max = mid;
- else
- min = mid + 1;
- }
+ charcode = (FT_UInt32)( charcodeRow * 256 + charcodeCol );
- charcode = 0;
- if ( min < cmap->num_encodings )
- {
- charcode = (FT_ULong)encodings[min].enc;
- result = encodings[min].glyph + 1;
+ result = (FT_UInt)enc->offset[ ( charcodeRow - enc->firstRow ) *
+ ( enc->lastCol - enc->firstCol + 1 ) +
+ charcodeCol - enc->firstCol ];
+ if ( result != 0xFFFFU )
+ break;
}
- Exit:
- if ( charcode > 0xFFFFFFFFUL )
- {
- FT_TRACE1(( "pcf_cmap_char_next: charcode 0x%x > 32bit API" ));
- *acharcode = 0;
- /* XXX: result should be changed to indicate an overflow error */
- }
- else
- *acharcode = (FT_UInt32)charcode;
+ *acharcode = charcode;
+
return result;
}
@@ -216,8 +198,8 @@ THE SOFTWARE.
memory = FT_FACE_MEMORY( face );
- FT_FREE( face->encodings );
FT_FREE( face->metrics );
+ FT_FREE( face->enc.offset );
/* free properties */
if ( face->properties )
@@ -512,9 +494,6 @@ THE SOFTWARE.
stream = face->root.stream;
- if ( glyph_index > 0 )
- glyph_index--;
-
metric = face->metrics + glyph_index;
bitmap->rows = (unsigned int)( metric->ascent +
@@ -601,11 +580,11 @@ THE SOFTWARE.
}
- /*
- *
- * BDF SERVICE
- *
- */
+ /*
+ *
+ * BDF SERVICE
+ *
+ */
static FT_Error
pcf_get_bdf_property( PCF_Face face,
@@ -633,9 +612,9 @@ THE SOFTWARE.
}
/*
- * The PCF driver loads all properties as signed integers.
- * This really doesn't seem to be a problem, because this is
- * sufficient for any meaningful values.
+ * The PCF driver loads all properties as signed integers.
+ * This really doesn't seem to be a problem, because this is
+ * sufficient for any meaningful values.
*/
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
aproperty->u.integer = (FT_Int32)prop->value.l;
@@ -668,7 +647,7 @@ THE SOFTWARE.
/*
- * PROPERTY SERVICE
+ * PROPERTY SERVICE
*
*/
static FT_Error
@@ -777,11 +756,11 @@ THE SOFTWARE.
(FT_Properties_GetFunc)pcf_property_get ) /* get_property */
- /*
- *
- * SERVICE LIST
- *
- */
+ /*
+ *
+ * SERVICE LIST
+ *
+ */
static const FT_ServiceDescRec pcf_services[] =
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.h b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.h
index 29d30497cd6..73db0823d25 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.h
@@ -31,11 +31,8 @@ THE SOFTWARE.
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
-FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
+FT_BEGIN_HEADER
FT_EXPORT_VAR( const FT_Driver_ClassRec ) pcf_driver_class;
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcferror.h b/Build/source/libs/freetype2/freetype-src/src/pcf/pcferror.h
index add8ef2230e..2e69d1d2198 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcferror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcferror.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* pcferror.h */
-/* */
-/* PCF error codes (specification only). */
-/* */
-/* Copyright 2001, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the PCF error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * pcferror.h
+ *
+ * PCF error codes (specification only).
+ *
+ * Copyright 2001, 2012 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the PCF error enumeration constants.
+ *
+ */
#ifndef PCFERROR_H_
#define PCFERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
index 537da0dc79b..71143ecfb54 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
@@ -37,14 +37,14 @@ THE SOFTWARE.
#include "pcferror.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_pcfread
+#define FT_COMPONENT pcfread
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -178,23 +178,23 @@ THE SOFTWARE.
}
/*
- * We now check whether the `size' and `offset' values are reasonable:
- * `offset' + `size' must not exceed the stream size.
+ * We now check whether the `size' and `offset' values are reasonable:
+ * `offset' + `size' must not exceed the stream size.
*
- * Note, however, that X11's `pcfWriteFont' routine (used by the
- * `bdftopcf' program to create PDF font files) has two special
- * features.
+ * Note, however, that X11's `pcfWriteFont' routine (used by the
+ * `bdftopcf' program to create PCF font files) has two special
+ * features.
*
- * - It always assigns the accelerator table a size of 100 bytes in the
- * TOC, regardless of its real size, which can vary between 34 and 72
- * bytes.
+ * - It always assigns the accelerator table a size of 100 bytes in the
+ * TOC, regardless of its real size, which can vary between 34 and 72
+ * bytes.
*
- * - Due to the way the routine is designed, it ships out the last font
- * table with its real size, ignoring the TOC's size value. Since
- * the TOC size values are always rounded up to a multiple of 4, the
- * difference can be up to three bytes for all tables except the
- * accelerator table, for which the difference can be as large as 66
- * bytes.
+ * - Due to the way the routine is designed, it ships out the last font
+ * table with its real size, ignoring the TOC's size value. Since
+ * the TOC size values are always rounded up to a multiple of 4, the
+ * difference can be up to three bytes for all tables except the
+ * accelerator table, for which the difference can be as large as 66
+ * bytes.
*
*/
@@ -810,8 +810,8 @@ THE SOFTWARE.
{
FT_Error error;
FT_Memory memory = FT_FACE( face )->memory;
- FT_Long* offsets = NULL;
- FT_Long bitmapSizes[GLYPHPADOPTIONS];
+ FT_ULong* offsets = NULL;
+ FT_ULong bitmapSizes[GLYPHPADOPTIONS];
FT_ULong format, size;
FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0;
@@ -878,11 +878,11 @@ THE SOFTWARE.
for ( i = 0; i < nbitmaps; i++ )
{
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
- (void)FT_READ_LONG( offsets[i] );
+ (void)FT_READ_ULONG( offsets[i] );
else
- (void)FT_READ_LONG_LE( offsets[i] );
+ (void)FT_READ_ULONG_LE( offsets[i] );
- FT_TRACE5(( " bitmap %ld: offset %ld (0x%lX)\n",
+ FT_TRACE5(( " bitmap %lu: offset %lu (0x%lX)\n",
i, offsets[i], offsets[i] ));
}
if ( error )
@@ -891,22 +891,22 @@ THE SOFTWARE.
for ( i = 0; i < GLYPHPADOPTIONS; i++ )
{
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
- (void)FT_READ_LONG( bitmapSizes[i] );
+ (void)FT_READ_ULONG( bitmapSizes[i] );
else
- (void)FT_READ_LONG_LE( bitmapSizes[i] );
+ (void)FT_READ_ULONG_LE( bitmapSizes[i] );
if ( error )
goto Bail;
- sizebitmaps = (FT_ULong)bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
+ sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
- FT_TRACE4(( " %ld-bit padding implies a size of %ld\n",
+ FT_TRACE4(( " %ld-bit padding implies a size of %lu\n",
8 << i, bitmapSizes[i] ));
}
- FT_TRACE4(( " %ld bitmaps, using %ld-bit padding\n",
+ FT_TRACE4(( " %lu bitmaps, using %ld-bit padding\n",
nbitmaps,
8 << PCF_GLYPH_PAD_INDEX( format ) ));
- FT_TRACE4(( " bitmap size: %ld\n", sizebitmaps ));
+ FT_TRACE4(( " bitmap size: %lu\n", sizebitmaps ));
FT_UNUSED( sizebitmaps ); /* only used for debugging */
@@ -915,14 +915,13 @@ THE SOFTWARE.
for ( i = 0; i < nbitmaps; i++ )
{
/* rough estimate */
- if ( ( offsets[i] < 0 ) ||
- ( (FT_ULong)offsets[i] > size ) )
+ if ( offsets[i] > size )
{
FT_TRACE0(( "pcf_get_bitmaps:"
- " invalid offset to bitmap data of glyph %ld\n", i ));
+ " invalid offset to bitmap data of glyph %lu\n", i ));
}
else
- face->metrics[i].bits = stream->pos + (FT_ULong)offsets[i];
+ face->metrics[i].bits = stream->pos + offsets[i];
}
face->bitmapsFormat = format;
@@ -933,20 +932,58 @@ THE SOFTWARE.
}
+ /*
+ * This file uses X11 terminology for PCF data; an `encoding' in X11 speak
+ * is the same as a character code in FreeType speak.
+ */
+#define PCF_ENC_SIZE 10
+
+ static
+ const FT_Frame_Field pcf_enc_header[] =
+ {
+#undef FT_STRUCTURE
+#define FT_STRUCTURE PCF_EncRec
+
+ FT_FRAME_START( PCF_ENC_SIZE ),
+ FT_FRAME_USHORT_LE( firstCol ),
+ FT_FRAME_USHORT_LE( lastCol ),
+ FT_FRAME_USHORT_LE( firstRow ),
+ FT_FRAME_USHORT_LE( lastRow ),
+ FT_FRAME_USHORT_LE( defaultChar ),
+ FT_FRAME_END
+ };
+
+
+ static
+ const FT_Frame_Field pcf_enc_msb_header[] =
+ {
+#undef FT_STRUCTURE
+#define FT_STRUCTURE PCF_EncRec
+
+ FT_FRAME_START( PCF_ENC_SIZE ),
+ FT_FRAME_USHORT( firstCol ),
+ FT_FRAME_USHORT( lastCol ),
+ FT_FRAME_USHORT( firstRow ),
+ FT_FRAME_USHORT( lastRow ),
+ FT_FRAME_USHORT( defaultChar ),
+ FT_FRAME_END
+ };
+
+
static FT_Error
pcf_get_encodings( FT_Stream stream,
PCF_Face face )
{
- FT_Error error;
- FT_Memory memory = FT_FACE( face )->memory;
- FT_ULong format, size;
- int firstCol, lastCol;
- int firstRow, lastRow;
- FT_ULong nencoding;
- FT_UShort encodingOffset;
- int i, j;
- FT_ULong k;
- PCF_Encoding encoding = NULL;
+ FT_Error error;
+ FT_Memory memory = FT_FACE( face )->memory;
+ FT_ULong format, size;
+ PCF_Enc enc = &face->enc;
+ FT_ULong nencoding;
+ FT_UShort* offset;
+ FT_UShort defaultCharRow, defaultCharCol;
+ FT_UShort encodingOffset, defaultCharEncodingOffset;
+ FT_UShort i, j;
+ FT_Byte* pos;
error = pcf_seek_to_table_type( stream,
@@ -956,75 +993,118 @@ THE SOFTWARE.
&format,
&size );
if ( error )
- return error;
+ goto Bail;
- error = FT_Stream_EnterFrame( stream, 14 );
- if ( error )
- return error;
+ if ( FT_READ_ULONG_LE( format ) )
+ goto Bail;
- format = FT_GET_ULONG_LE();
+ FT_TRACE4(( "pcf_get_encodings:\n"
+ " format: 0x%lX (%s)\n",
+ format,
+ PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" ));
+
+ if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) &&
+ !PCF_FORMAT_MATCH( format, PCF_BDF_ENCODINGS ) )
+ return FT_THROW( Invalid_File_Format );
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
{
- firstCol = FT_GET_SHORT();
- lastCol = FT_GET_SHORT();
- firstRow = FT_GET_SHORT();
- lastRow = FT_GET_SHORT();
- face->defaultChar = FT_GET_SHORT();
+ if ( FT_STREAM_READ_FIELDS( pcf_enc_msb_header, enc ) )
+ goto Bail;
}
else
{
- firstCol = FT_GET_SHORT_LE();
- lastCol = FT_GET_SHORT_LE();
- firstRow = FT_GET_SHORT_LE();
- lastRow = FT_GET_SHORT_LE();
- face->defaultChar = FT_GET_SHORT_LE();
+ if ( FT_STREAM_READ_FIELDS( pcf_enc_header, enc ) )
+ goto Bail;
}
- FT_Stream_ExitFrame( stream );
-
- FT_TRACE4(( "pcf_get_encodings:\n"
- " format: 0x%lX (%s)\n",
- format,
- PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" ));
-
- if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
- return FT_THROW( Invalid_File_Format );
-
FT_TRACE4(( " firstCol 0x%X, lastCol 0x%X\n"
- " firstRow 0x%X, lastRow 0x%X\n",
- firstCol, lastCol,
- firstRow, lastRow ));
+ " firstRow 0x%X, lastRow 0x%X\n"
+ " defaultChar 0x%X\n",
+ enc->firstCol, enc->lastCol,
+ enc->firstRow, enc->lastRow,
+ enc->defaultChar ));
/* sanity checks; we limit numbers of rows and columns to 256 */
- if ( firstCol < 0 ||
- firstCol > lastCol ||
- lastCol > 0xFF ||
- firstRow < 0 ||
- firstRow > lastRow ||
- lastRow > 0xFF )
+ if ( enc->firstCol > enc->lastCol ||
+ enc->lastCol > 0xFF ||
+ enc->firstRow > enc->lastRow ||
+ enc->lastRow > 0xFF )
return FT_THROW( Invalid_Table );
- nencoding = (FT_ULong)( lastCol - firstCol + 1 ) *
- (FT_ULong)( lastRow - firstRow + 1 );
+ nencoding = (FT_ULong)( enc->lastCol - enc->firstCol + 1 ) *
+ (FT_ULong)( enc->lastRow - enc->firstRow + 1 );
- if ( FT_NEW_ARRAY( encoding, nencoding ) )
- return error;
+ if ( FT_NEW_ARRAY( enc->offset, nencoding ) )
+ goto Bail;
error = FT_Stream_EnterFrame( stream, 2 * nencoding );
if ( error )
- goto Bail;
+ goto Exit;
FT_TRACE5(( "\n" ));
- k = 0;
- for ( i = firstRow; i <= lastRow; i++ )
+ defaultCharRow = enc->defaultChar >> 8;
+ defaultCharCol = enc->defaultChar & 0xFF;
+
+ /* validate default character */
+ if ( defaultCharRow < enc->firstRow ||
+ defaultCharRow > enc->lastRow ||
+ defaultCharCol < enc->firstCol ||
+ defaultCharCol > enc->lastCol )
+ {
+ enc->defaultChar = enc->firstRow * 256U + enc->firstCol;
+ FT_TRACE0(( "pcf_get_encodings:"
+ " Invalid default character set to %u\n",
+ enc->defaultChar ));
+
+ defaultCharRow = enc->firstRow;
+ defaultCharCol = enc->firstCol;
+ }
+
+ /* FreeType mandates that glyph index 0 is the `undefined glyph', */
+ /* which PCF calls the `default character'. For this reason, we */
+ /* swap the positions of glyph index 0 and the index corresponding */
+ /* to `defaultChar' in case they are different. */
+
+ /* `stream->cursor' still points at the beginning of the frame; */
+ /* we can thus easily get the offset to the default character */
+ pos = stream->cursor +
+ 2 * ( ( defaultCharRow - enc->firstRow ) *
+ ( enc->lastCol - enc->firstCol + 1 ) +
+ defaultCharCol - enc->firstCol );
+
+ if ( PCF_BYTE_ORDER( format ) == MSBFirst )
+ defaultCharEncodingOffset = FT_PEEK_USHORT( pos );
+ else
+ defaultCharEncodingOffset = FT_PEEK_USHORT_LE( pos );
+
+ if ( defaultCharEncodingOffset >= face->nmetrics )
+ {
+ FT_TRACE0(( "pcf_get_encodings:"
+ " Invalid glyph index for default character,"
+ " setting to zero\n" ));
+ defaultCharEncodingOffset = 0;
+ }
+
+ if ( defaultCharEncodingOffset )
+ {
+ /* do the swapping */
+ PCF_MetricRec tmp = face->metrics[defaultCharEncodingOffset];
+
+
+ face->metrics[defaultCharEncodingOffset] = face->metrics[0];
+ face->metrics[0] = tmp;
+ }
+
+ offset = enc->offset;
+ for ( i = enc->firstRow; i <= enc->lastRow; i++ )
{
- for ( j = firstCol; j <= lastCol; j++ )
+ for ( j = enc->firstCol; j <= enc->lastCol; j++ )
{
/* X11's reference implementation uses the equivalent to */
/* `FT_GET_SHORT', however PCF fonts with more than 32768 */
- /* characters (e.g. `unifont.pcf') clearly show that an */
+ /* characters (e.g., `unifont.pcf') clearly show that an */
/* unsigned value is needed. */
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
encodingOffset = FT_GET_USHORT();
@@ -1033,28 +1113,23 @@ THE SOFTWARE.
if ( encodingOffset != 0xFFFFU )
{
- encoding[k].enc = i * 256 + j;
- encoding[k].glyph = encodingOffset;
-
- FT_TRACE5(( " code %d (0x%04X): idx %d\n",
- encoding[k].enc, encoding[k].enc, encoding[k].glyph ));
-
- k++;
+ if ( encodingOffset == defaultCharEncodingOffset )
+ encodingOffset = 0;
+ else if ( encodingOffset == 0 )
+ encodingOffset = defaultCharEncodingOffset;
}
+
+ *offset++ = encodingOffset;
}
}
FT_Stream_ExitFrame( stream );
- if ( FT_RENEW_ARRAY( encoding, nencoding, k ) )
- goto Bail;
-
- face->nencodings = k;
- face->encodings = encoding;
-
return error;
+ Exit:
+ FT_FREE( enc->offset );
+
Bail:
- FT_FREE( encoding );
return error;
}
@@ -1397,8 +1472,7 @@ THE SOFTWARE.
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
- FT_FACE_FLAG_HORIZONTAL |
- FT_FACE_FLAG_FAST_GLYPHS;
+ FT_FACE_FLAG_HORIZONTAL;
if ( face->accel.constantWidth )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
@@ -1482,14 +1556,7 @@ THE SOFTWARE.
else
root->family_name = NULL;
- /*
- * Note: We shift all glyph indices by +1 since we must
- * respect the convention that glyph 0 always corresponds
- * to the `missing glyph'.
- *
- * This implies bumping the number of `available' glyphs by 1.
- */
- root->num_glyphs = (FT_Long)( face->nmetrics + 1 );
+ root->num_glyphs = (FT_Long)face->nmetrics;
root->num_fixed_sizes = 1;
if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfutil.c b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfutil.c
index 0451ee8deff..045c42d60f3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfutil.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfutil.c
@@ -37,7 +37,7 @@ in this Software without prior written authorization from The Open Group.
/*
- * Invert bit order within each BYTE of an array.
+ * Invert bit order within each BYTE of an array.
*/
FT_LOCAL_DEF( void )
@@ -59,7 +59,7 @@ in this Software without prior written authorization from The Open Group.
/*
- * Invert byte order within each 16-bits of an array.
+ * Invert byte order within each 16-bits of an array.
*/
FT_LOCAL_DEF( void )
@@ -78,7 +78,7 @@ in this Software without prior written authorization from The Open Group.
}
/*
- * Invert byte order within each 32-bits of an array.
+ * Invert byte order within each 32-bits of an array.
*/
FT_LOCAL_DEF( void )
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/Jamfile b/Build/source/libs/freetype2/freetype-src/src/pfr/Jamfile
index cb55a7ee89a..fbca8065c4b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/pfr Jamfile
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/pfr/module.mk b/Build/source/libs/freetype2/freetype-src/src/pfr/module.mk
index 27fec8e5f61..30d876d4c82 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/pfr/pfr.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfr.c
index 1760882fcdb..6d885ea47f6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfr.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfr.c */
-/* */
-/* FreeType PFR driver component. */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfr.c
+ *
+ * FreeType PFR driver component.
+ *
+ * Copyright (C) 2002-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.c
index 60643780a16..bfa1b9ea05a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrcmap.c */
-/* */
-/* FreeType PFR cmap handling (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrcmap.c
+ *
+ * FreeType PFR cmap handling (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.h
index c70a0c83c50..1e203a0514d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrcmap.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrcmap.h */
-/* */
-/* FreeType PFR cmap handling (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrcmap.h
+ *
+ * FreeType PFR cmap handling (specification).
+ *
+ * Copyright (C) 2002-2019 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 PFRCMAP_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.c
index 6c7e50128a2..f67eebf1189 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrdrivr.c */
-/* */
-/* FreeType PFR driver interface (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrdrivr.c
+ *
+ * FreeType PFR driver interface (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -57,10 +57,10 @@
}
- /*
- * PFR METRICS SERVICE
- *
- */
+ /*
+ * PFR METRICS SERVICE
+ *
+ */
FT_CALLBACK_DEF( FT_Error )
pfr_get_advance( FT_Face pfrface, /* PFR_Face */
@@ -145,10 +145,10 @@
};
- /*
- * SERVICE LIST
- *
- */
+ /*
+ * SERVICE LIST
+ *
+ */
static const FT_ServiceDescRec pfr_services[] =
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.h
index cab852789b9..33b7b9413f2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrdrivr.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrdrivr.h */
-/* */
-/* High-level Type PFR driver interface (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrdrivr.h
+ *
+ * High-level Type PFR driver interface (specification).
+ *
+ * Copyright (C) 2002-2019 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 PFRDRIVR_H_
@@ -26,14 +26,8 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
-
FT_EXPORT_VAR( const FT_Driver_ClassRec ) pfr_driver_class;
-
FT_END_HEADER
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrerror.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrerror.h
index 7027c818e89..4829cfc0000 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrerror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrerror.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* pfrerror.h */
-/* */
-/* PFR error codes (specification only). */
-/* */
-/* Copyright 2002-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the PFR error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * pfrerror.h
+ *
+ * PFR error codes (specification only).
+ *
+ * Copyright (C) 2002-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the PFR error enumeration constants.
+ *
+ */
#ifndef PFRERROR_H_
#define PFRERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.c
index b7990196b6e..6ef5856a8dc 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrgload.c */
-/* */
-/* FreeType PFR glyph loader (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrgload.c
+ *
+ * FreeType PFR glyph loader (body).
+ *
+ * Copyright (C) 2002-2019 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 "pfrgload.h"
@@ -24,7 +24,7 @@
#include "pfrerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pfr
+#define FT_COMPONENT pfr
/*************************************************************************/
@@ -359,9 +359,9 @@
FT_UInt format, format_low, args_format = 0, args_count, n;
- /***************************************************************/
- /* read instruction */
- /* */
+ /****************************************************************
+ * read instruction
+ */
PFR_CHECK( 1 );
format = PFR_NEXT_BYTE( p );
format_low = format & 15;
@@ -426,9 +426,9 @@
args_format = format_low;
}
- /***********************************************************/
- /* now read arguments */
- /* */
+ /************************************************************
+ * now read arguments
+ */
cur = pos;
for ( n = 0; n < args_count; n++ )
{
@@ -513,9 +513,9 @@
FT_TRACE7(( "\n" ));
- /***********************************************************/
- /* finally, execute instruction */
- /* */
+ /************************************************************
+ * finally, execute instruction
+ */
switch ( format >> 4 )
{
case 0: /* end glyph => EXIT */
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.h
index 01f48d7706a..d0e1420b671 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrgload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrgload.h */
-/* */
-/* FreeType PFR glyph loader (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrgload.h
+ *
+ * FreeType PFR glyph loader (specification).
+ *
+ * Copyright (C) 2002-2019 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 PFRGLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.c
index 2776da462a8..ccf0b7e1f89 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrload.c */
-/* */
-/* FreeType PFR loader (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrload.c
+ *
+ * FreeType PFR loader (body).
+ *
+ * Copyright (C) 2002-2019 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 "pfrload.h"
@@ -23,92 +23,92 @@
#include "pfrerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pfr
+#define FT_COMPONENT pfr
/*
- * The overall structure of a PFR file is as follows.
+ * The overall structure of a PFR file is as follows.
*
- * PFR header
- * 58 bytes (contains nPhysFonts)
+ * PFR header
+ * 58 bytes (contains nPhysFonts)
*
- * Logical font directory (size at most 2^16 bytes)
- * 2 bytes (nLogFonts)
- * + nLogFonts * 5 bytes
+ * Logical font directory (size at most 2^16 bytes)
+ * 2 bytes (nLogFonts)
+ * + nLogFonts * 5 bytes
*
- * ==> nLogFonts <= 13106
+ * ==> nLogFonts <= 13106
*
- * Logical font section (size at most 2^24 bytes)
- * nLogFonts * logFontRecord
+ * Logical font section (size at most 2^24 bytes)
+ * nLogFonts * logFontRecord
*
- * logFontRecord (size at most 2^16 bytes)
- * 12 bytes (fontMatrix)
- * + 1 byte (flags)
- * + 0-5 bytes (depending on `flags')
- * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags')
- * + 5 bytes (physical font info)
- * + 0-1 bytes (depending on PFR header)
+ * logFontRecord (size at most 2^16 bytes)
+ * 12 bytes (fontMatrix)
+ * + 1 byte (flags)
+ * + 0-5 bytes (depending on `flags')
+ * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags')
+ * + 5 bytes (physical font info)
+ * + 0-1 bytes (depending on PFR header)
*
- * ==> minimum size 18 bytes
+ * ==> minimum size 18 bytes
*
- * Physical font section (size at most 2^24 bytes)
- * nPhysFonts * (physFontRecord
- * + nBitmapSizes * nBmapChars * bmapCharRecord)
+ * Physical font section (size at most 2^24 bytes)
+ * nPhysFonts * (physFontRecord
+ * + nBitmapSizes * nBmapChars * bmapCharRecord)
*
- * physFontRecord (size at most 2^24 bytes)
- * 14 bytes (font info)
- * + 1 byte (flags)
- * + 0-2 (depending on `flags')
- * + 0-? (structure too complicated to be shown here; depending on
- * `flags'; contains `nBitmapSizes' and `nBmapChars')
- * + 3 bytes (nAuxBytes)
- * + nAuxBytes
- * + 1 byte (nBlueValues)
- * + 2 * nBlueValues
- * + 6 bytes (hinting data)
- * + 2 bytes (nCharacters)
- * + nCharacters * (4-10 bytes) (depending on `flags')
+ * physFontRecord (size at most 2^24 bytes)
+ * 14 bytes (font info)
+ * + 1 byte (flags)
+ * + 0-2 (depending on `flags')
+ * + 0-? (structure too complicated to be shown here; depending on
+ * `flags'; contains `nBitmapSizes' and `nBmapChars')
+ * + 3 bytes (nAuxBytes)
+ * + nAuxBytes
+ * + 1 byte (nBlueValues)
+ * + 2 * nBlueValues
+ * + 6 bytes (hinting data)
+ * + 2 bytes (nCharacters)
+ * + nCharacters * (4-10 bytes) (depending on `flags')
*
- * ==> minimum size 27 bytes
+ * ==> minimum size 27 bytes
*
- * bmapCharRecord
- * 4-7 bytes
+ * bmapCharRecord
+ * 4-7 bytes
*
- * Glyph program strings (three possible types: simpleGps, compoundGps,
- * and bitmapGps; size at most 2^24 bytes)
- * simpleGps (size at most 2^16 bytes)
- * 1 byte (flags)
- * 1-2 bytes (n[XY]orus, depending on `flags')
- * 0-(64+512*2) = 0-1088 bytes (depending on `n[XY]orus')
- * 0-? (structure too complicated to be shown here; depending on
- * `flags')
- * 1-? glyph data (faintly resembling PS Type 1 charstrings)
+ * Glyph program strings (three possible types: simpleGps, compoundGps,
+ * and bitmapGps; size at most 2^24 bytes)
+ * simpleGps (size at most 2^16 bytes)
+ * 1 byte (flags)
+ * 1-2 bytes (n[XY]orus, depending on `flags')
+ * 0-(64+512*2) = 0-1088 bytes (depending on `n[XY]orus')
+ * 0-? (structure too complicated to be shown here; depending on
+ * `flags')
+ * 1-? glyph data (faintly resembling PS Type 1 charstrings)
*
- * ==> minimum size 3 bytes
+ * ==> minimum size 3 bytes
*
- * compoundGps (size at most 2^16 bytes)
- * 1 byte (nElements <= 63, flags)
- * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags')
- * + nElements * (6-14 bytes)
+ * compoundGps (size at most 2^16 bytes)
+ * 1 byte (nElements <= 63, flags)
+ * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags')
+ * + nElements * (6-14 bytes)
*
- * bitmapGps (size at most 2^16 bytes)
- * 1 byte (flags)
- * 3-13 bytes (position info, depending on `flags')
- * 0-? bitmap data
+ * bitmapGps (size at most 2^16 bytes)
+ * 1 byte (flags)
+ * 3-13 bytes (position info, depending on `flags')
+ * 0-? bitmap data
*
- * ==> minimum size 4 bytes
+ * ==> minimum size 4 bytes
*
- * PFR trailer
- * 8 bytes
+ * PFR trailer
+ * 8 bytes
*
*
- * ==> minimum size of a valid PFR:
- * 58 (header)
- * + 2 (nLogFonts)
- * + 27 (1 physFontRecord)
- * + 8 (trailer)
- * -----
- * 95 bytes
+ * ==> minimum size of a valid PFR:
+ * 58 (header)
+ * + 2 (nLogFonts)
+ * + 27 (1 physFontRecord)
+ * + 8 (trailer)
+ * -----
+ * 95 bytes
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.h
index 36e809a762c..2e7ffd01270 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrload.h */
-/* */
-/* FreeType PFR loader (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrload.h
+ *
+ * FreeType PFR loader (specification).
+ *
+ * Copyright (C) 2002-2019 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 PFRLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.c
index 737b97b5ff2..e103a3f6f28 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrobjs.c */
-/* */
-/* FreeType PFR object methods (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrobjs.c
+ *
+ * FreeType PFR object methods (body).
+ *
+ * Copyright (C) 2002-2019 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 "pfrobjs.h"
@@ -29,7 +29,7 @@
#include "pfrerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pfr
+#define FT_COMPONENT pfr
/*************************************************************************/
@@ -122,7 +122,7 @@
stream,
(FT_UInt)( face_index & 0xFFFF ),
face->header.log_dir_offset,
- FT_BOOL( face->header.phy_font_max_size_high != 0 ) );
+ FT_BOOL( face->header.phy_font_max_size_high ) );
if ( error )
goto Exit;
@@ -370,7 +370,7 @@
FT_Bool scaling;
- scaling = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
+ scaling = FT_BOOL( !( load_flags & FT_LOAD_NO_SCALE ) );
/* copy outline data */
*outline = slot->glyph.loader->base.outline;
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.h
index 59c709f58d0..39cffd07c5c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrobjs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrobjs.h */
-/* */
-/* FreeType PFR object methods (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrobjs.h
+ *
+ * FreeType PFR object methods (specification).
+ *
+ * Copyright (C) 2002-2019 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 PFROBJS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.c b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.c
index ba909ddca75..00a9616455d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrsbit.c */
-/* */
-/* FreeType PFR bitmap loader (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrsbit.c
+ *
+ * FreeType PFR bitmap loader (body).
+ *
+ * Copyright (C) 2002-2019 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 "pfrsbit.h"
@@ -24,7 +24,7 @@
#include "pfrerror.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pfr
+#define FT_COMPONENT pfr
/*************************************************************************/
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.h
index 07b27bc06cc..6568b90943f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrsbit.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrsbit.h */
-/* */
-/* FreeType PFR bitmap loader (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrsbit.h
+ *
+ * FreeType PFR bitmap loader (specification).
+ *
+ * Copyright (C) 2002-2019 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 PFRSBIT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrtypes.h b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrtypes.h
index 058d6aadc9a..6a5f9d571b4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/pfrtypes.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/pfrtypes.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pfrtypes.h */
-/* */
-/* FreeType PFR data structures (specification only). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pfrtypes.h
+ *
+ * FreeType PFR data structures (specification only).
+ *
+ * Copyright (C) 2002-2019 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 PFRTYPES_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pfr/rules.mk b/Build/source/libs/freetype2/freetype-src/src/pfr/rules.mk
index 3acb7956969..f14ca699e28 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pfr/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/pfr/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/psaux/Jamfile b/Build/source/libs/freetype2/freetype-src/src/psaux/Jamfile
index a231d5974f5..30bcc1c0978 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/psaux Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c
index 0c33d5949bc..49225a9f78e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afmparse.c */
-/* */
-/* AFM parser (body). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afmparse.c
+ *
+ * AFM parser (body).
+ *
+ * Copyright (C) 2006-2019 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 <ft2build.h>
#include FT_FREETYPE_H
@@ -28,13 +28,13 @@
#include "psauxerr.h"
-/***************************************************************************/
-/* */
-/* AFM_Stream */
-/* */
-/* The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib. */
-/* */
-/* */
+ /**************************************************************************
+ *
+ * AFM_Stream
+ *
+ * The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib.
+ *
+ */
enum
{
@@ -193,11 +193,11 @@
}
- /*************************************************************************/
- /* */
- /* AFM_Parser */
- /* */
- /* */
+ /**************************************************************************
+ *
+ * AFM_Parser
+ *
+ */
/* all keys defined in Ch. 7-10 of 5004.AFM_Spec.pdf */
typedef enum AFM_Token_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h
index 86f852a2477..2ceb77553b2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* afmparse.h */
-/* */
-/* AFM parser (specification). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * afmparse.h
+ *
+ * AFM parser (specification).
+ *
+ * Copyright (C) 2006-2019 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 AFMPARSE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c
index 80d622c0e1b..17cccf818b4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffdecode.c */
-/* */
-/* PostScript CFF (Type 2) decoding routines (body). */
-/* */
-/* Copyright 2017-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffdecode.c
+ *
+ * PostScript CFF (Type 2) decoding routines (body).
+ *
+ * Copyright (C) 2017-2019 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 <ft2build.h>
@@ -28,14 +28,14 @@
#include "psauxerr.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cffdecode
+#define FT_COMPONENT cffdecode
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
@@ -235,8 +235,8 @@
return FT_THROW( Syntax_Error );
}
- adx += decoder->builder.left_bearing.x;
- ady += decoder->builder.left_bearing.y;
+ adx = ADD_LONG( adx, decoder->builder.left_bearing.x );
+ ady = ADD_LONG( ady, decoder->builder.left_bearing.y );
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* Incremental fonts don't necessarily have valid charsets. */
@@ -378,23 +378,26 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_compute_bias */
- /* */
- /* <Description> */
- /* Computes the bias value in dependence of the number of glyph */
- /* subroutines. */
- /* */
- /* <Input> */
- /* in_charstring_type :: The `CharstringType' value of the top DICT */
- /* dictionary. */
- /* */
- /* num_subrs :: The number of glyph subroutines. */
- /* */
- /* <Return> */
- /* The bias value. */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_compute_bias
+ *
+ * @Description:
+ * Computes the bias value in dependence of the number of glyph
+ * subroutines.
+ *
+ * @Input:
+ * in_charstring_type ::
+ * The `CharstringType' value of the top DICT
+ * dictionary.
+ *
+ * num_subrs ::
+ * The number of glyph subroutines.
+ *
+ * @Return:
+ * The bias value.
+ */
static FT_Int
cff_compute_bias( FT_Int in_charstring_type,
FT_UInt num_subrs )
@@ -464,28 +467,32 @@
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_decoder_parse_charstrings */
- /* */
- /* <Description> */
- /* Parses a given Type 2 charstrings program. */
- /* */
- /* <InOut> */
- /* decoder :: The current Type 1 decoder. */
- /* */
- /* <Input> */
- /* charstring_base :: The base of the charstring stream. */
- /* */
- /* charstring_len :: The length in bytes of the charstring stream. */
- /* */
- /* in_dict :: Set to 1 if function is called from top or */
- /* private DICT (needed for Multiple Master CFFs). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_decoder_parse_charstrings
+ *
+ * @Description:
+ * Parses a given Type 2 charstrings program.
+ *
+ * @InOut:
+ * decoder ::
+ * The current Type 1 decoder.
+ *
+ * @Input:
+ * charstring_base ::
+ * The base of the charstring stream.
+ *
+ * charstring_len ::
+ * The length in bytes of the charstring stream.
+ *
+ * in_dict ::
+ * Set to 1 if function is called from top or
+ * private DICT (needed for Multiple Master CFFs).
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
cff_decoder_parse_charstrings( CFF_Decoder* decoder,
FT_Byte* charstring_base,
@@ -543,10 +550,10 @@
FT_Byte v;
- /********************************************************************/
- /* */
- /* Decode operator or operand */
- /* */
+ /*********************************************************************
+ *
+ * Decode operator or operand
+ */
v = *ip++;
if ( v >= 32 || v == 28 )
{
@@ -853,6 +860,15 @@
case cff_op_flex1:
case cff_op_callsubr:
case cff_op_callgsubr:
+ /* deprecated opcodes */
+ case cff_op_dotsection:
+ /* invalid Type 1 opcodes */
+ case cff_op_hsbw:
+ case cff_op_closepath:
+ case cff_op_callothersubr:
+ case cff_op_seac:
+ case cff_op_sbw:
+ case cff_op_setcurrentpoint:
goto MM_Error;
default:
@@ -948,10 +964,10 @@
case cff_op_hstemhm:
case cff_op_vstemhm:
/* the number of arguments is always even here */
- FT_TRACE4((
- op == cff_op_hstem ? " hstem\n" :
- ( op == cff_op_vstem ? " vstem\n" :
- ( op == cff_op_hstemhm ? " hstemhm\n" : " vstemhm\n" ) ) ));
+ FT_TRACE4(( "%s\n",
+ op == cff_op_hstem ? " hstem" :
+ ( op == cff_op_vstem ? " vstem" :
+ ( op == cff_op_hstemhm ? " hstemhm" : " vstemhm" ) ) ));
if ( hinter )
hinter->stems( hinter->hints,
@@ -965,7 +981,8 @@
case cff_op_hintmask:
case cff_op_cntrmask:
- FT_TRACE4(( op == cff_op_hintmask ? " hintmask" : " cntrmask" ));
+ FT_TRACE4(( "%s", op == cff_op_hintmask ? " hintmask"
+ : " cntrmask" ));
/* implement vstem when needed -- */
/* the specification doesn't say it, but this also works */
@@ -1078,8 +1095,8 @@
FT_Int phase = ( op == cff_op_hlineto );
- FT_TRACE4(( op == cff_op_hlineto ? " hlineto\n"
- : " vlineto\n" ));
+ FT_TRACE4(( "%s\n", op == cff_op_hlineto ? " hlineto"
+ : " vlineto" ));
if ( num_args < 0 )
goto Stack_Underflow;
@@ -1250,8 +1267,8 @@
FT_Int nargs;
- FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto\n"
- : " hvcurveto\n" ));
+ FT_TRACE4(( "%s\n", op == cff_op_vhcurveto ? " vhcurveto"
+ : " hvcurveto" ));
if ( cff_builder_start_point( builder, x, y ) )
goto Fail;
@@ -1539,9 +1556,9 @@
}
if ( dx < 0 )
- dx = -dx;
+ dx = NEG_LONG( dx );
if ( dy < 0 )
- dy = -dy;
+ dy = NEG_LONG( dy );
/* strange test, but here it is... */
horizontal = ( dx > dy );
@@ -1551,7 +1568,7 @@
x = ADD_LONG( x, args[0] );
y = ADD_LONG( y, args[1] );
cff_builder_add_point( builder, x, y,
- (FT_Bool)( count == 3 ) );
+ FT_BOOL( count == 3 ) );
args += 2;
}
@@ -1589,7 +1606,7 @@
x = ADD_LONG( x, args[0] );
y = ADD_LONG( y, args[1] );
cff_builder_add_point( builder, x, y,
- (FT_Bool)( count == 4 || count == 1 ) );
+ FT_BOOL( count == 4 || count == 1 ) );
args += 2;
}
@@ -1705,16 +1722,20 @@
break;
case cff_op_random:
- FT_TRACE4(( " random\n" ));
+ {
+ FT_UInt32* randval = in_dict ? &decoder->cff->top_font.random
+ : &decoder->current_subfont->random;
- /* only use the lower 16 bits of `random' */
- /* to generate a number in the range (0;1] */
- args[0] = (FT_Fixed)
- ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
- args++;
- decoder->current_subfont->random =
- cff_random( decoder->current_subfont->random );
+ FT_TRACE4(( " random\n" ));
+
+ /* only use the lower 16 bits of `random' */
+ /* to generate a number in the range (0;1] */
+ args[0] = (FT_Fixed)( ( *randval & 0xFFFF ) + 1 );
+ args++;
+
+ *randval = cff_random( *randval );
+ }
break;
case cff_op_mul:
@@ -1727,7 +1748,10 @@
case cff_op_sqrt:
FT_TRACE4(( " sqrt\n" ));
- if ( args[0] > 0 )
+ /* without upper limit the loop below might not finish */
+ if ( args[0] > 0x7FFFFFFFL )
+ args[0] = 46341;
+ else if ( args[0] > 0 )
{
FT_Fixed root = args[0];
FT_Fixed new_root;
@@ -1800,6 +1824,7 @@
if ( idx >= 0 )
{
+ idx = idx % count;
while ( idx > 0 )
{
FT_Fixed tmp = args[count - 1];
@@ -1814,6 +1839,10 @@
}
else
{
+ /* before C99 it is implementation-defined whether */
+ /* the result of `%' is negative if the first operand */
+ /* is negative */
+ idx = -( NEG_INT( idx ) % count );
while ( idx < 0 )
{
FT_Fixed tmp = args[0];
@@ -1914,6 +1943,7 @@
case cff_op_blend:
/* this operator was removed from the Type2 specification */
/* in version 16-March-2000 */
+ if ( num_designs )
{
FT_Int num_results = (FT_Int)( args[0] >> 16 );
@@ -1923,7 +1953,8 @@
if ( num_results < 0 )
goto Syntax_Error;
- if ( num_results * (FT_Int)num_designs > num_args )
+ if ( num_results > num_args ||
+ num_results * (FT_Int)num_designs > num_args )
goto Stack_Underflow;
/* since we currently don't handle interpolation of multiple */
@@ -1932,6 +1963,8 @@
args -= num_results * ( num_designs - 1 );
num_args -= num_results * ( num_designs - 1 );
}
+ else
+ goto Syntax_Error;
break;
case cff_op_dotsection:
@@ -1998,20 +2031,31 @@
break;
case cff_op_callothersubr:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
+ {
+ FT_Fixed arg;
- FT_TRACE4(( " callothersubr (invalid op)\n" ));
- /* subsequent `pop' operands should add the arguments, */
- /* this is the implementation described for `unknown' other */
- /* subroutines in the Type1 spec. */
- /* */
- /* XXX Fix return arguments (see discussion below). */
- args -= 2 + ( args[-2] >> 16 );
- if ( args < stack )
- goto Stack_Underflow;
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from */
+ /* probably Type 1 to CFF, and some parsers seem to accept */
+ /* it */
+
+ FT_TRACE4(( " callothersubr (invalid op)\n" ));
+
+ /* subsequent `pop' operands should add the arguments, */
+ /* this is the implementation described for `unknown' */
+ /* other subroutines in the Type1 spec. */
+ /* */
+ /* XXX Fix return arguments (see discussion below). */
+
+ arg = 2 + ( args[-2] >> 16 );
+ if ( arg >= CFF_MAX_OPERANDS )
+ goto Stack_Underflow;
+
+ args -= arg;
+ if ( args < stack )
+ goto Stack_Underflow;
+ }
break;
case cff_op_pop:
@@ -2251,28 +2295,34 @@
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_decoder_init */
- /* */
- /* <Description> */
- /* Initializes a given glyph decoder. */
- /* */
- /* <InOut> */
- /* decoder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* size :: The current size object. */
- /* */
- /* slot :: The current glyph object. */
- /* */
- /* hinting :: Whether hinting is active. */
- /* */
- /* hint_mode :: The hinting mode. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_decoder_init
+ *
+ * @Description:
+ * Initializes a given glyph decoder.
+ *
+ * @InOut:
+ * decoder ::
+ * A pointer to the glyph builder to initialize.
+ *
+ * @Input:
+ * face ::
+ * The current face object.
+ *
+ * size ::
+ * The current size object.
+ *
+ * slot ::
+ * The current glyph object.
+ *
+ * hinting ::
+ * Whether hinting is active.
+ *
+ * hint_mode ::
+ * The hinting mode.
+ */
FT_LOCAL_DEF( void )
cff_decoder_init( CFF_Decoder* decoder,
TT_Face face,
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h
index 0d4f5fef631..a6691979f0c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffdecode.h */
-/* */
-/* PostScript CFF (Type 2) decoding routines (specification). */
-/* */
-/* Copyright 2017-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffdecode.h
+ *
+ * PostScript CFF (Type 2) decoding routines (specification).
+ *
+ * Copyright (C) 2017-2019 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 CFFDECODE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk b/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk
index 6584d075a29..bb0886abdfc 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c
index a8780947f9d..011803b4161 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psarrst.c */
-/* */
-/* Adobe's code for Array Stacks (body). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psarrst.c
+ *
+ * Adobe's code for Array Stacks (body).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h
index b3568eb61fc..098617b2575 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psarrst.h */
-/* */
-/* Adobe's code for Array Stacks (specification). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psarrst.h
+ *
+ * Adobe's code for Array Stacks (specification).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSARRST_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c
index fb447fcdbbc..1db04625514 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psaux.c */
-/* */
-/* FreeType auxiliary PostScript driver component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psaux.c
+ *
+ * FreeType auxiliary PostScript driver component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h
index cc33fd2eeac..523e1886c22 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* psauxerr.h */
-/* */
-/* PS auxiliary module error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the PS auxiliary module error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * psauxerr.h
+ *
+ * PS auxiliary module error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the PS auxiliary module error enumeration
+ * constants.
+ *
+ */
#ifndef PSAUXERR_H_
#define PSAUXERR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c
index ee497085cc2..5df8e690561 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psauxmod.c */
-/* */
-/* FreeType auxiliary PostScript module implementation (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psauxmod.c
+ *
+ * FreeType auxiliary PostScript module implementation (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h
index f30978f0220..a0eda0bfc03 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psauxmod.h */
-/* */
-/* FreeType auxiliary PostScript module implementation (specification). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psauxmod.h
+ *
+ * FreeType auxiliary PostScript module implementation (specification).
+ *
+ * Copyright (C) 2000-2019 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 PSAUXMOD_H_
@@ -28,10 +28,6 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
FT_CALLBACK_TABLE
const CFF_Builder_FuncsRec cff_builder_funcs;
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c
index ae39d03c777..89738ce4749 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psblues.c */
-/* */
-/* Adobe's code for handling Blue Zones (body). */
-/* */
-/* Copyright 2009-2014 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psblues.c
+ *
+ * Adobe's code for handling Blue Zones (body).
+ *
+ * Copyright 2009-2014 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
@@ -44,14 +44,14 @@
#include "psfont.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cf2blues
+#define FT_COMPONENT cf2blues
/*
@@ -452,13 +452,13 @@
* zones in the same pass (see `BlueLock'). If a hint is captured,
* return true and position the edge(s) in one of 3 ways:
*
- * 1) If `BlueScale' suppresses overshoot, position the captured edge
- * at the flat edge of the zone.
- * 2) If overshoot is not suppressed and `BlueShift' requires
- * overshoot, position the captured edge a minimum of 1 device pixel
- * from the flat edge.
- * 3) If overshoot is not suppressed or required, position the captured
- * edge at the nearest device pixel.
+ * 1) If `BlueScale' suppresses overshoot, position the captured edge
+ * at the flat edge of the zone.
+ * 2) If overshoot is not suppressed and `BlueShift' requires
+ * overshoot, position the captured edge a minimum of 1 device pixel
+ * from the flat edge.
+ * 3) If overshoot is not suppressed or required, position the captured
+ * edge at the nearest device pixel.
*
*/
FT_LOCAL_DEF( FT_Bool )
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.h
index 25ef6849c77..55fb88ecddf 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psblues.h */
-/* */
-/* Adobe's code for handling Blue Zones (specification). */
-/* */
-/* Copyright 2009-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psblues.h
+ *
+ * Adobe's code for handling Blue Zones (specification).
+ *
+ * Copyright 2009-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
/*
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c
index a03385000df..c88761681cc 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psconv.c */
-/* */
-/* Some convenience conversions (body). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psconv.c
+ *
+ * Some convenience conversions (body).
+ *
+ * Copyright (C) 2006-2019 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 <ft2build.h>
@@ -24,14 +24,14 @@
#include "psauxerr.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_psconv
+#define FT_COMPONENT psconv
/* The following array is used by various functions to quickly convert */
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h
index d643ffcfc2c..6b24bf6fc95 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psconv.h */
-/* */
-/* Some convenience conversions (specification). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psconv.h
+ *
+ * Some convenience conversions (specification).
+ *
+ * Copyright (C) 2006-2019 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 PSCONV_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.c b/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.c
index 9169e5222d0..98cebcf74d9 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* pserror.c */
-/* */
-/* Adobe's code for error handling (body). */
-/* */
-/* Copyright 2006-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pserror.c
+ *
+ * Adobe's code for error handling (body).
+ *
+ * Copyright 2006-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.h b/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.h
index 13d52062bf3..b2156b3318b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/pserror.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* pserror.h */
-/* */
-/* Adobe's code for error handling (specification). */
-/* */
-/* Copyright 2006-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pserror.h
+ *
+ * Adobe's code for error handling (specification).
+ *
+ * Copyright 2006-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psfixed.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psfixed.h
index 219589e7fc7..fd3460f34af 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psfixed.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psfixed.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psfixed.h */
-/* */
-/* Adobe's code for Fixed Point Mathematics (specification only). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psfixed.h
+ *
+ * Adobe's code for Fixed Point Mathematics (specification only).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSFIXED_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.c
index dde67a739d6..bb5faa38f5c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psfont.c */
-/* */
-/* Adobe's code for font instances (body). */
-/* */
-/* Copyright 2007-2014 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psfont.c
+ *
+ * Adobe's code for font instances (body).
+ *
+ * Copyright 2007-2014 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include <ft2build.h>
@@ -331,7 +331,7 @@
}
/* copy hinted flag on each call */
- font->hinted = (FT_Bool)( font->renderingFlags & CF2_FlagsHinted );
+ font->hinted = FT_BOOL( font->renderingFlags & CF2_FlagsHinted );
/* determine if transform has changed; */
/* include Fontmatrix but ignore translation */
@@ -366,7 +366,7 @@
if ( font->stemDarkened != ( font->renderingFlags & CF2_FlagsDarkened ) )
{
font->stemDarkened =
- (FT_Bool)( font->renderingFlags & CF2_FlagsDarkened );
+ FT_BOOL( font->renderingFlags & CF2_FlagsDarkened );
/* blue zones depend on darkened flag */
needExtraSetup = TRUE;
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.h
index e611ac4bdc8..8fbacbb6e34 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psfont.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psfont.h */
-/* */
-/* Adobe's code for font instances (specification). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psfont.h
+ *
+ * Adobe's code for font instances (specification).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSFONT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psft.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psft.c
index 1f750174a1c..54be4683430 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psft.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psft.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psft.c */
-/* */
-/* FreeType Glue Component to Adobe's Interpreter (body). */
-/* */
-/* Copyright 2013-2014 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psft.c
+ *
+ * FreeType Glue Component to Adobe's Interpreter (body).
+ *
+ * Copyright 2013-2014 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
@@ -120,12 +120,12 @@
}
- /********************************************/
- /* */
- /* functions for handling client outline; */
- /* FreeType uses coordinates in 26.6 format */
- /* */
- /********************************************/
+ /*********************************************
+ *
+ * functions for handling client outline;
+ * FreeType uses coordinates in 26.6 format
+ *
+ */
static void
cf2_builder_moveTo( CF2_OutlineCallbacks callbacks,
@@ -767,13 +767,14 @@
cf2_freeT1SeacComponent( PS_Decoder* decoder,
CF2_Buffer buf )
{
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+
T1_Face face;
FT_Data data;
FT_ASSERT( decoder );
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
face = (T1_Face)decoder->builder.face;
data.pointer = buf->start;
@@ -783,7 +784,13 @@
face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object,
&data );
-#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+
+#else /* !FT_CONFIG_OPTION_INCREMENTAL */
+
+ FT_UNUSED( decoder );
+ FT_UNUSED( buf );
+
+#endif /* !FT_CONFIG_OPTION_INCREMENTAL */
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psft.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psft.h
index ab172110bb6..4c930f0d73f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psft.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psft.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psft.h */
-/* */
-/* FreeType Glue Component to Adobe's Interpreter (specification). */
-/* */
-/* Copyright 2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psft.h
+ *
+ * FreeType Glue Component to Adobe's Interpreter (specification).
+ *
+ * Copyright 2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSFT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psglue.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psglue.h
index 5545e12a5bf..022aafbfcac 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psglue.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psglue.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psglue.h */
-/* */
-/* Adobe's code for shared stuff (specification only). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psglue.h
+ *
+ * Adobe's code for shared stuff (specification only).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSGLUE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c b/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c
index 36151964253..1cbecd2b193 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* pshints.c */
-/* */
-/* Adobe's code for handling CFF hints (body). */
-/* */
-/* Copyright 2007-2014 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshints.c
+ *
+ * Adobe's code for handling CFF hints (body).
+ *
+ * Copyright 2007-2014 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
@@ -45,14 +45,14 @@
#include "psintrp.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cf2hints
+#define FT_COMPONENT cf2hints
typedef struct CF2_HintMoveRec_
@@ -217,52 +217,49 @@
FT_LOCAL_DEF( FT_Bool )
cf2_hint_isValid( const CF2_Hint hint )
{
- return (FT_Bool)( hint->flags != 0 );
+ return FT_BOOL( hint->flags );
}
static FT_Bool
cf2_hint_isPair( const CF2_Hint hint )
{
- return (FT_Bool)( ( hint->flags &
- ( CF2_PairBottom | CF2_PairTop ) ) != 0 );
+ return FT_BOOL( hint->flags & ( CF2_PairBottom | CF2_PairTop ) );
}
static FT_Bool
cf2_hint_isPairTop( const CF2_Hint hint )
{
- return (FT_Bool)( ( hint->flags & CF2_PairTop ) != 0 );
+ return FT_BOOL( hint->flags & CF2_PairTop );
}
FT_LOCAL_DEF( FT_Bool )
cf2_hint_isTop( const CF2_Hint hint )
{
- return (FT_Bool)( ( hint->flags &
- ( CF2_PairTop | CF2_GhostTop ) ) != 0 );
+ return FT_BOOL( hint->flags & ( CF2_PairTop | CF2_GhostTop ) );
}
FT_LOCAL_DEF( FT_Bool )
cf2_hint_isBottom( const CF2_Hint hint )
{
- return (FT_Bool)( ( hint->flags &
- ( CF2_PairBottom | CF2_GhostBottom ) ) != 0 );
+ return FT_BOOL( hint->flags & ( CF2_PairBottom | CF2_GhostBottom ) );
}
static FT_Bool
cf2_hint_isLocked( const CF2_Hint hint )
{
- return (FT_Bool)( ( hint->flags & CF2_Locked ) != 0 );
+ return FT_BOOL( hint->flags & CF2_Locked );
}
static FT_Bool
cf2_hint_isSynthetic( const CF2_Hint hint )
{
- return (FT_Bool)( ( hint->flags & CF2_Synthetic ) != 0 );
+ return FT_BOOL( hint->flags & CF2_Synthetic );
}
@@ -334,7 +331,7 @@
cf2_hintmap_map( CF2_HintMap hintmap,
CF2_Fixed csCoord )
{
- if ( hintmap->count == 0 || ! hintmap->hinted )
+ if ( hintmap->count == 0 || !hintmap->hinted )
{
/* there are no hints; use uniform scale and zero offset */
return FT_MulFix( csCoord, hintmap->scale );
@@ -497,7 +494,7 @@
{
move = moveDown;
/* true if non-optimum move */
- saveEdge = (FT_Bool)( moveUp < -moveDown );
+ saveEdge = FT_BOOL( moveUp < -moveDown );
}
else
{
@@ -1025,10 +1022,10 @@
}
}
- FT_TRACE6(( initialMap ? "flags: [p]air [g]host [t]op "
- "[b]ottom [L]ocked [S]ynthetic\n"
- "Initial hintmap\n"
- : "Hints:\n" ));
+ FT_TRACE6(( "%s\n", initialMap ? "flags: [p]air [g]host [t]op"
+ " [b]ottom [L]ocked [S]ynthetic\n"
+ "Initial hintmap"
+ : "Hints:" ));
cf2_hintmap_dump( hintmap );
/*
@@ -1215,7 +1212,7 @@
* (`u').
*
* See notation in
- * http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm.
+ * http://geomalgorithms.com/a05-_intersect-1.html.
* Calculations are done in 16.16, but must handle the squaring of
* line lengths in character space. We scale all vectors by 1/32 to
* avoid overflow. This allows values up to 4095 to be squared. The
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.h b/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.h
index 92e37e98aef..31a8230364c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* pshints.h */
-/* */
-/* Adobe's code for handling CFF hints (body). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshints.h
+ *
+ * Adobe's code for handling CFF hints (body).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSHINT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c
index da5a8dad1db..e2f3accdd5c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psintrp.c */
-/* */
-/* Adobe's CFF Interpreter (body). */
-/* */
-/* Copyright 2007-2014 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psintrp.c
+ *
+ * Adobe's CFF Interpreter (body).
+ *
+ * Copyright 2007-2014 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
@@ -52,14 +52,14 @@
#include "t1decode.h" /* for t1 seac */
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_cf2interp
+#define FT_COMPONENT cf2interp
FT_LOCAL_DEF( void )
@@ -287,7 +287,7 @@
{
CF2_UInt i;
CF2_UInt count = cf2_stack_count( opStack );
- FT_Bool hasWidthArg = (FT_Bool)( count & 1 );
+ FT_Bool hasWidthArg = FT_BOOL( count & 1 );
/* variable accumulates delta values from operand stack */
CF2_Fixed position = hintOffset;
@@ -364,7 +364,7 @@
if ( doConditionalLastRead )
{
- FT_Bool lastIsX = (FT_Bool)(
+ FT_Bool lastIsX = FT_BOOL(
cf2_fixedAbs( SUB_INT32( vals[10], *curX ) ) >
cf2_fixedAbs( SUB_INT32( vals[11], *curY ) ) );
CF2_Fixed lastVal = cf2_stack_getReal( opStack, idx );
@@ -612,14 +612,14 @@
cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 );
charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );
- *charstring = *buf; /* structure copy */
-
- charstringIndex = 0; /* entry is valid now */
/* catch errors so far */
if ( *error )
goto exit;
+ *charstring = *buf; /* structure copy */
+ charstringIndex = 0; /* entry is valid now */
+
/* main interpreter loop */
while ( 1 )
{
@@ -663,6 +663,7 @@
/* Skip outline commands first time round. */
/* `endchar' will trigger initial hintmap build */
/* and rewind the charstring. */
+ FT_TRACE4(( " <outline command skipped>\n" ));
cf2_stack_clear( opStack );
continue;
}
@@ -775,7 +776,8 @@
case cf2_cmdHSTEMHM:
case cf2_cmdHSTEM:
- FT_TRACE4(( op1 == cf2_cmdHSTEMHM ? " hstemhm\n" : " hstem\n" ));
+ FT_TRACE4(( "%s\n", op1 == cf2_cmdHSTEMHM ? " hstemhm"
+ : " hstem" ));
if ( !font->isT1 )
{
@@ -805,7 +807,8 @@
case cf2_cmdVSTEMHM:
case cf2_cmdVSTEM:
- FT_TRACE4(( op1 == cf2_cmdVSTEMHM ? " vstemhm\n" : " vstem\n" ));
+ FT_TRACE4(( "%s\n", op1 == cf2_cmdVSTEMHM ? " vstemhm"
+ : " vstem" ));
if ( !font->isT1 )
{
@@ -888,7 +891,7 @@
FT_Bool isX = FT_BOOL( op1 == cf2_cmdHLINETO );
- FT_TRACE4(( isX ? " hlineto\n" : " vlineto\n" ));
+ FT_TRACE4(( "%s\n", isX ? " hlineto" : " vlineto" ));
for ( idx = 0; idx < count; idx++ )
{
@@ -916,8 +919,8 @@
CF2_UInt idx = 0;
- FT_TRACE4(( op1 == cf2_cmdRCURVELINE ? " rcurveline\n"
- : " rrcurveto\n" ));
+ FT_TRACE4(( "%s\n", op1 == cf2_cmdRCURVELINE ? " rcurveline"
+ : " rrcurveto" ));
while ( idx + 6 <= count )
{
@@ -957,10 +960,10 @@
FT_TRACE4(( " unknown op (%d)\n", op1 ));
else
{
- FT_TRACE4(( " closepath" ));
+ FT_TRACE4(( " closepath\n" ));
/* if there is no path, `closepath' is a no-op */
- ps_builder_close_contour( &decoder->builder );
+ cf2_glyphpath_closeOpenPath( &glyphPath );
haveWidth = TRUE;
}
@@ -972,8 +975,8 @@
CF2_Int subrNum;
- FT_TRACE4(( op1 == cf2_cmdCALLGSUBR ? " callgsubr"
- : " callsubr" ));
+ FT_TRACE4(( "%s", op1 == cf2_cmdCALLGSUBR ? " callgsubr"
+ : " callsubr" ));
if ( ( !font->isT1 && charstringIndex > CF2_MAX_SUBR ) ||
( font->isT1 && charstringIndex > T1_MAX_SUBRS_CALLS ) )
@@ -1212,8 +1215,8 @@
FT_Bool isV = FT_BOOL( op2 == cf2_escVSTEM3 );
- FT_TRACE4(( isV ? " vstem3\n"
- : " hstem3\n" ));
+ FT_TRACE4(( "%s\n", isV ? " vstem3"
+ : " hstem3" ));
FT_ASSERT( cf2_stack_count( opStack ) == 6 );
@@ -1644,16 +1647,17 @@
subr_no = cf2_stack_popInt( opStack );
arg_cnt = cf2_stack_popInt( opStack );
- /*******************************************************/
- /* */
- /* remove all operands to callothersubr from the stack */
- /* */
- /* for handled othersubrs, where we know the number of */
- /* arguments, we increase the stack by the value of */
- /* known_othersubr_result_cnt */
- /* */
- /* for unhandled othersubrs the following pops adjust */
- /* the stack pointer as necessary */
+ /********************************************************
+ *
+ * remove all operands to callothersubr from the stack
+ *
+ * for handled othersubrs, where we know the number of
+ * arguments, we increase the stack by the value of
+ * known_othersubr_result_cnt
+ *
+ * for unhandled othersubrs the following pops adjust
+ * the stack pointer as necessary
+ */
count = cf2_stack_count( opStack );
FT_ASSERT( (CF2_UInt)arg_cnt <= count );
@@ -2416,7 +2420,7 @@
PS_Builder* builder;
- FT_TRACE4(( " hsbw" ));
+ FT_TRACE4(( " hsbw\n" ));
builder = &decoder->builder;
@@ -2562,7 +2566,7 @@
case cf2_cmdHINTMASK:
/* the final \n in the tracing message gets added in */
/* `cf2_hintmask_read' (which also traces the mask bytes) */
- FT_TRACE4(( op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" ));
+ FT_TRACE4(( "%s", op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" ));
/* never add hints after the mask is computed */
if ( cf2_stack_count( opStack ) > 1 &&
@@ -2828,7 +2832,7 @@
count = count1 & ~2U;
idx += count1 - count;
- FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" ));
+ FT_TRACE4(( "%s\n", alternate ? " hvcurveto" : " vhcurveto" ));
while ( idx < count )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.h
index 4790aaa302a..669c09c0ae5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psintrp.h */
-/* */
-/* Adobe's CFF Interpreter (specification). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psintrp.h
+ *
+ * Adobe's CFF Interpreter (specification).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSINTRP_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c
index f54bc7e4164..e2168a33240 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psobjs.c */
-/* */
-/* Auxiliary functions for PostScript fonts (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psobjs.c
+ *
+ * Auxiliary functions for PostScript fonts (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -29,14 +29,14 @@
#include "psauxmod.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_psobjs
+#define FT_COMPONENT psobjs
/*************************************************************************/
@@ -47,26 +47,29 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_table_new */
- /* */
- /* <Description> */
- /* Initializes a PS_Table. */
- /* */
- /* <InOut> */
- /* table :: The address of the target table. */
- /* */
- /* <Input> */
- /* count :: The table size = the maximum number of elements. */
- /* */
- /* memory :: The memory object to use for all subsequent */
- /* reallocations. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ps_table_new
+ *
+ * @Description:
+ * Initializes a PS_Table.
+ *
+ * @InOut:
+ * table ::
+ * The address of the target table.
+ *
+ * @Input:
+ * count ::
+ * The table size = the maximum number of elements.
+ *
+ * memory ::
+ * The memory object to use for all subsequent
+ * reallocations.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
ps_table_new( PS_Table table,
FT_Int count,
@@ -144,28 +147,32 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_table_add */
- /* */
- /* <Description> */
- /* Adds an object to a PS_Table, possibly growing its memory block. */
- /* */
- /* <InOut> */
- /* table :: The target table. */
- /* */
- /* <Input> */
- /* idx :: The index of the object in the table. */
- /* */
- /* object :: The address of the object to copy in memory. */
- /* */
- /* length :: The length in bytes of the source object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. An error is returned if a */
- /* reallocation fails. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ps_table_add
+ *
+ * @Description:
+ * Adds an object to a PS_Table, possibly growing its memory block.
+ *
+ * @InOut:
+ * table ::
+ * The target table.
+ *
+ * @Input:
+ * idx ::
+ * The index of the object in the table.
+ *
+ * object ::
+ * The address of the object to copy in memory.
+ *
+ * length ::
+ * The length in bytes of the source object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success. An error is returned if a
+ * reallocation fails.
+ */
FT_LOCAL_DEF( FT_Error )
ps_table_add( PS_Table table,
FT_Int idx,
@@ -216,22 +223,23 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_table_done */
- /* */
- /* <Description> */
- /* Finalizes a PS_TableRec (i.e., reallocate it to its current */
- /* cursor). */
- /* */
- /* <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. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ps_table_done
+ *
+ * @Description:
+ * Finalizes a PS_TableRec (i.e., reallocate it to its current
+ * cursor).
+ *
+ * @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 )
{
@@ -498,12 +506,12 @@
}
- /***********************************************************************/
- /* */
- /* All exported parsing routines handle leading whitespace and stop at */
- /* the first character which isn't part of the just handled token. */
- /* */
- /***********************************************************************/
+ /************************************************************************
+ *
+ * All exported parsing routines handle leading whitespace and stop at
+ * the first character which isn't part of the just handled token.
+ *
+ */
FT_LOCAL_DEF( void )
@@ -1100,18 +1108,22 @@
{
case T1_FIELD_TYPE_BOOL:
val = ps_tobool( &cur, limit );
+ FT_TRACE4(( " %s", val ? "true" : "false" ));
goto Store_Integer;
case T1_FIELD_TYPE_FIXED:
val = PS_Conv_ToFixed( &cur, limit, 0 );
+ FT_TRACE4(( " %f", (double)val / 65536 ));
goto Store_Integer;
case T1_FIELD_TYPE_FIXED_1000:
val = PS_Conv_ToFixed( &cur, limit, 3 );
+ FT_TRACE4(( " %f", (double)val / 65536 / 1000 ));
goto Store_Integer;
case T1_FIELD_TYPE_INTEGER:
val = PS_Conv_ToInt( &cur, limit );
+ FT_TRACE4(( " %ld", val ));
/* fall through */
Store_Integer:
@@ -1188,6 +1200,13 @@
FT_MEM_COPY( string, cur, len );
string[len] = 0;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( token.type == T1_TOKEN_TYPE_STRING )
+ FT_TRACE4(( " (%s)", string ));
+ else
+ FT_TRACE4(( " /%s", string ));
+#endif
+
*(FT_String**)q = string;
}
break;
@@ -1213,6 +1232,12 @@
bbox->yMin = FT_RoundFix( temp[1] );
bbox->xMax = FT_RoundFix( temp[2] );
bbox->yMax = FT_RoundFix( temp[3] );
+
+ FT_TRACE4(( " [%d %d %d %d]",
+ bbox->xMin / 65536,
+ bbox->yMin / 65536,
+ bbox->xMax / 65536,
+ bbox->yMax / 65536 ));
}
break;
@@ -1251,6 +1276,7 @@
skip_spaces( &cur, limit );
}
+ FT_TRACE4(( " [" ));
for ( i = 0; i < max_objects; i++ )
{
FT_BBox* bbox = (FT_BBox*)objects[i];
@@ -1260,7 +1286,14 @@
bbox->yMin = FT_RoundFix( temp[i + max_objects] );
bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] );
bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] );
+
+ FT_TRACE4(( " [%d %d %d %d]",
+ bbox->xMin / 65536,
+ bbox->yMin / 65536,
+ bbox->xMax / 65536,
+ bbox->yMax / 65536 ));
}
+ FT_TRACE4(( "]" ));
FT_FREE( temp );
}
@@ -1333,6 +1366,8 @@
*(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) =
(FT_Byte)num_elements;
+ FT_TRACE4(( " [" ));
+
/* we now load each element, adjusting the field.offset on each one */
token = elements;
for ( ; num_elements > 0; num_elements--, token++ )
@@ -1351,6 +1386,8 @@
fieldrec.offset += fieldrec.size;
}
+ FT_TRACE4(( "]" ));
+
#if 0 /* obsolete -- keep for reference */
if ( pflags )
*pflags |= 1L << field->flag_bit;
@@ -1410,6 +1447,8 @@
bytes,
max_bytes );
+ parser->cursor = cur;
+
if ( delimiters )
{
if ( cur < parser->limit && *cur != '>' )
@@ -1419,11 +1458,9 @@
goto Exit;
}
- cur++;
+ parser->cursor++;
}
- parser->cursor = cur;
-
Exit:
return error;
}
@@ -1509,26 +1546,31 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_builder_init */
- /* */
- /* <Description> */
- /* Initializes a given glyph builder. */
- /* */
- /* <InOut> */
- /* builder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* size :: The current size object. */
- /* */
- /* glyph :: The current glyph object. */
- /* */
- /* hinting :: Whether hinting should be applied. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * t1_builder_init
+ *
+ * @Description:
+ * Initializes a given glyph builder.
+ *
+ * @InOut:
+ * builder ::
+ * A pointer to the glyph builder to initialize.
+ *
+ * @Input:
+ * face ::
+ * The current face object.
+ *
+ * size ::
+ * The current size object.
+ *
+ * glyph ::
+ * The current glyph object.
+ *
+ * hinting ::
+ * Whether hinting should be applied.
+ */
FT_LOCAL_DEF( void )
t1_builder_init( T1_Builder builder,
FT_Face face,
@@ -1572,19 +1614,20 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_builder_done */
- /* */
- /* <Description> */
- /* Finalizes a given glyph builder. Its contents can still be used */
- /* after the call, but the function saves important information */
- /* within the corresponding glyph slot. */
- /* */
- /* <Input> */
- /* builder :: A pointer to the glyph builder to finalize. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * t1_builder_done
+ *
+ * @Description:
+ * Finalizes a given glyph builder. Its contents can still be used
+ * after the call, but the function saves important information
+ * within the corresponding glyph slot.
+ *
+ * @Input:
+ * builder ::
+ * A pointer to the glyph builder to finalize.
+ */
FT_LOCAL_DEF( void )
t1_builder_done( T1_Builder builder )
{
@@ -1769,26 +1812,31 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_builder_init */
- /* */
- /* <Description> */
- /* Initializes a given glyph builder. */
- /* */
- /* <InOut> */
- /* builder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* size :: The current size object. */
- /* */
- /* glyph :: The current glyph object. */
- /* */
- /* hinting :: Whether hinting is active. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_builder_init
+ *
+ * @Description:
+ * Initializes a given glyph builder.
+ *
+ * @InOut:
+ * builder ::
+ * A pointer to the glyph builder to initialize.
+ *
+ * @Input:
+ * face ::
+ * The current face object.
+ *
+ * size ::
+ * The current size object.
+ *
+ * glyph ::
+ * The current glyph object.
+ *
+ * hinting ::
+ * Whether hinting is active.
+ */
FT_LOCAL_DEF( void )
cff_builder_init( CFF_Builder* builder,
TT_Face face,
@@ -1841,19 +1889,20 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_builder_done */
- /* */
- /* <Description> */
- /* Finalizes a given glyph builder. Its contents can still be used */
- /* after the call, but the function saves important information */
- /* within the corresponding glyph slot. */
- /* */
- /* <Input> */
- /* builder :: A pointer to the glyph builder to finalize. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * cff_builder_done
+ *
+ * @Description:
+ * Finalizes a given glyph builder. Its contents can still be used
+ * after the call, but the function saves important information
+ * within the corresponding glyph slot.
+ *
+ * @Input:
+ * builder ::
+ * A pointer to the glyph builder to finalize.
+ */
FT_LOCAL_DEF( void )
cff_builder_done( CFF_Builder* builder )
{
@@ -1993,6 +2042,14 @@
first = outline->n_contours <= 1
? 0 : outline->contours[outline->n_contours - 2] + 1;
+ /* in malformed fonts it can happen that a contour was started */
+ /* but no points were added */
+ if ( outline->n_contours && first == outline->n_points )
+ {
+ outline->n_contours--;
+ return;
+ }
+
/* We must not include the last point in the path if it */
/* is located on the first point. */
if ( outline->n_points > 1 )
@@ -2033,26 +2090,31 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_builder_init */
- /* */
- /* <Description> */
- /* Initializes a given glyph builder. */
- /* */
- /* <InOut> */
- /* builder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* size :: The current size object. */
- /* */
- /* glyph :: The current glyph object. */
- /* */
- /* hinting :: Whether hinting should be applied. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ps_builder_init
+ *
+ * @Description:
+ * Initializes a given glyph builder.
+ *
+ * @InOut:
+ * builder ::
+ * A pointer to the glyph builder to initialize.
+ *
+ * @Input:
+ * face ::
+ * The current face object.
+ *
+ * size ::
+ * The current size object.
+ *
+ * glyph ::
+ * The current glyph object.
+ *
+ * hinting ::
+ * Whether hinting should be applied.
+ */
FT_LOCAL_DEF( void )
ps_builder_init( PS_Builder* ps_builder,
void* builder,
@@ -2116,19 +2178,20 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_builder_done */
- /* */
- /* <Description> */
- /* Finalizes a given glyph builder. Its contents can still be used */
- /* after the call, but the function saves important information */
- /* within the corresponding glyph slot. */
- /* */
- /* <Input> */
- /* builder :: A pointer to the glyph builder to finalize. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ps_builder_done
+ *
+ * @Description:
+ * Finalizes a given glyph builder. Its contents can still be used
+ * after the call, but the function saves important information
+ * within the corresponding glyph slot.
+ *
+ * @Input:
+ * builder ::
+ * A pointer to the glyph builder to finalize.
+ */
FT_LOCAL_DEF( void )
ps_builder_done( PS_Builder* builder )
{
@@ -2336,23 +2399,26 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_decoder_init */
- /* */
- /* <Description> */
- /* Creates a wrapper decoder for use in the combined */
- /* Type 1 / CFF interpreter. */
- /* */
- /* <InOut> */
- /* ps_decoder :: A pointer to the decoder to initialize. */
- /* */
- /* <Input> */
- /* decoder :: A pointer to the original decoder. */
- /* */
- /* is_t1 :: Flag indicating Type 1 or CFF */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ps_decoder_init
+ *
+ * @Description:
+ * Creates a wrapper decoder for use in the combined
+ * Type 1 / CFF interpreter.
+ *
+ * @InOut:
+ * ps_decoder ::
+ * A pointer to the decoder to initialize.
+ *
+ * @Input:
+ * decoder ::
+ * A pointer to the original decoder.
+ *
+ * is_t1 ::
+ * Flag indicating Type 1 or CFF
+ */
FT_LOCAL_DEF( void )
ps_decoder_init( PS_Decoder* ps_decoder,
void* decoder,
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h
index 8e0fe5fa4c0..9466a1d0754 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psobjs.h */
-/* */
-/* Auxiliary functions for PostScript fonts (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psobjs.h
+ *
+ * Auxiliary functions for PostScript fonts (specification).
+ *
+ * Copyright (C) 1996-2019 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 PSOBJS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psread.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psread.c
index 719863ce178..86bfc03c6e5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psread.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psread.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psread.c */
-/* */
-/* Adobe's code for stream handling (body). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psread.c
+ *
+ * Adobe's code for stream handling (body).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
@@ -105,7 +105,7 @@
FT_LOCAL_DEF( FT_Bool )
cf2_buf_isEnd( CF2_Buffer buf )
{
- return (FT_Bool)( buf->ptr >= buf->end );
+ return FT_BOOL( buf->ptr >= buf->end );
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psread.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psread.h
index 464b29ba743..9e55fe04470 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psread.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psread.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psread.h */
-/* */
-/* Adobe's code for stream handling (specification). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psread.h
+ *
+ * Adobe's code for stream handling (specification).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSREAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c
index 69d063349a1..6659068001c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psstack.c */
-/* */
-/* Adobe's code for emulating a CFF stack (body). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psstack.c
+ *
+ * Adobe's code for emulating a CFF stack (body).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#include "psft.h"
@@ -258,6 +258,9 @@
return;
}
+ /* before C99 it is implementation-defined whether */
+ /* the result of `%' is negative if the first operand */
+ /* is negative */
if ( shift < 0 )
shift = -( ( -shift ) % count );
else
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.h
index 38f7b41c689..18cd39bc6a0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* psstack.h */
-/* */
-/* Adobe's code for emulating a CFF stack (specification). */
-/* */
-/* Copyright 2007-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psstack.h
+ *
+ * Adobe's code for emulating a CFF stack (specification).
+ *
+ * Copyright 2007-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSSTACK_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/pstypes.h b/Build/source/libs/freetype2/freetype-src/src/psaux/pstypes.h
index dfbaa3d475b..041287e8d5e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/pstypes.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/pstypes.h
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* pstypes.h */
-/* */
-/* Adobe's code for defining data types (specification only). */
-/* */
-/* Copyright 2011-2013 Adobe Systems Incorporated. */
-/* */
-/* This software, and all works of authorship, whether in source or */
-/* object code form as indicated by the copyright notice(s) included */
-/* herein (collectively, the "Work") is made available, and may only be */
-/* used, modified, and distributed under the FreeType Project License, */
-/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
-/* FreeType Project License, each contributor to the Work hereby grants */
-/* to any individual or legal entity exercising permissions granted by */
-/* the FreeType Project License and this section (hereafter, "You" or */
-/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
-/* royalty-free, irrevocable (except as stated in this section) patent */
-/* license to make, have made, use, offer to sell, sell, import, and */
-/* otherwise transfer the Work, where such license applies only to those */
-/* patent claims licensable by such contributor that are necessarily */
-/* infringed by their contribution(s) alone or by combination of their */
-/* contribution(s) with the Work to which such contribution(s) was */
-/* submitted. If You institute patent litigation against any entity */
-/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
-/* the Work or a contribution incorporated within the Work constitutes */
-/* direct or contributory patent infringement, then any patent licenses */
-/* granted to You under this License for that Work shall terminate as of */
-/* the date such litigation is filed. */
-/* */
-/* By using, modifying, or distributing the Work you indicate that you */
-/* have read and understood the terms and conditions of the */
-/* FreeType Project License as well as those provided in this section, */
-/* and you accept them fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pstypes.h
+ *
+ * Adobe's code for defining data types (specification only).
+ *
+ * Copyright 2011-2013 Adobe Systems Incorporated.
+ *
+ * This software, and all works of authorship, whether in source or
+ * object code form as indicated by the copyright notice(s) included
+ * herein (collectively, the "Work") is made available, and may only be
+ * used, modified, and distributed under the FreeType Project License,
+ * LICENSE.TXT. Additionally, subject to the terms and conditions of the
+ * FreeType Project License, each contributor to the Work hereby grants
+ * to any individual or legal entity exercising permissions granted by
+ * the FreeType Project License and this section (hereafter, "You" or
+ * "Your") a perpetual, worldwide, non-exclusive, no-charge,
+ * royalty-free, irrevocable (except as stated in this section) patent
+ * license to make, have made, use, offer to sell, sell, import, and
+ * otherwise transfer the Work, where such license applies only to those
+ * patent claims licensable by such contributor that are necessarily
+ * infringed by their contribution(s) alone or by combination of their
+ * contribution(s) with the Work to which such contribution(s) was
+ * submitted. If You institute patent litigation against any entity
+ * (including a cross-claim or counterclaim in a lawsuit) alleging that
+ * the Work or a contribution incorporated within the Work constitutes
+ * direct or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate as of
+ * the date such litigation is filed.
+ *
+ * By using, modifying, or distributing the Work you indicate that you
+ * have read and understood the terms and conditions of the
+ * FreeType Project License as well as those provided in this section,
+ * and you accept them fully.
+ *
+ */
#ifndef PSTYPES_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk b/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk
index a87bfe96873..2de734d5474 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c
index 112a7892bac..d62d2d5c816 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1cmap.c */
-/* */
-/* Type 1 character map support (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1cmap.c
+ *
+ * Type 1 character map support (body).
+ *
+ * Copyright (C) 2002-2019 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 "t1cmap.h"
@@ -305,6 +305,9 @@
FT_UNUSED( pointer );
+ if ( !psnames->unicodes_init )
+ return FT_THROW( Unimplemented_Feature );
+
return psnames->unicodes_init( memory,
unicodes,
(FT_UInt)face->type1.num_glyphs,
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h
index 4308e31d2d7..d325e7b5a65 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1cmap.h */
-/* */
-/* Type 1 character map support (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1cmap.h
+ *
+ * Type 1 character map support (specification).
+ *
+ * Copyright (C) 2002-2019 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 T1CMAP_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c
index 6ad145661f2..c2b3729b539 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1decode.c */
-/* */
-/* PostScript Type 1 decoding routines (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1decode.c
+ *
+ * PostScript Type 1 decoding routines (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -31,14 +31,14 @@
/* ensure proper sign extension */
#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) )
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1decode
+#define FT_COMPONENT t1decode
typedef enum T1_Operator_
@@ -109,24 +109,26 @@
};
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_lookup_glyph_by_stdcharcode_ps */
- /* */
- /* <Description> */
- /* Looks up a given glyph by its StandardEncoding charcode. Used to */
- /* implement the SEAC Type 1 operator in the Adobe engine */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* charcode :: The character code to look for. */
- /* */
- /* <Return> */
- /* A glyph index in the font face. Returns -1 if the corresponding */
- /* glyph wasn't found. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * t1_lookup_glyph_by_stdcharcode_ps
+ *
+ * @Description:
+ * Looks up a given glyph by its StandardEncoding charcode. Used to
+ * implement the SEAC Type 1 operator in the Adobe engine
+ *
+ * @Input:
+ * face ::
+ * The current face object.
+ *
+ * charcode ::
+ * The character code to look for.
+ *
+ * @Return:
+ * A glyph index in the font face. Returns -1 if the corresponding
+ * glyph wasn't found.
+ */
FT_LOCAL_DEF( FT_Int )
t1_lookup_glyph_by_stdcharcode_ps( PS_Decoder* decoder,
FT_Int charcode )
@@ -159,24 +161,27 @@
#ifdef T1_CONFIG_OPTION_OLD_ENGINE
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_lookup_glyph_by_stdcharcode */
- /* */
- /* <Description> */
- /* Looks up a given glyph by its StandardEncoding charcode. Used to */
- /* implement the SEAC Type 1 operator. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* charcode :: The character code to look for. */
- /* */
- /* <Return> */
- /* A glyph index in the font face. Returns -1 if the corresponding */
- /* glyph wasn't found. */
- /* */
+
+ /**************************************************************************
+ *
+ * @Function:
+ * t1_lookup_glyph_by_stdcharcode
+ *
+ * @Description:
+ * Looks up a given glyph by its StandardEncoding charcode. Used to
+ * implement the SEAC Type 1 operator.
+ *
+ * @Input:
+ * face ::
+ * The current face object.
+ *
+ * charcode ::
+ * The character code to look for.
+ *
+ * @Return:
+ * A glyph index in the font face. Returns -1 if the corresponding
+ * glyph wasn't found.
+ */
static FT_Int
t1_lookup_glyph_by_stdcharcode( T1_Decoder decoder,
FT_Int charcode )
@@ -217,30 +222,36 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1operator_seac */
- /* */
- /* <Description> */
- /* Implements the `seac' Type 1 operator for a Type 1 decoder. */
- /* */
- /* <Input> */
- /* decoder :: The current CID decoder. */
- /* */
- /* asb :: The accent's side bearing. */
- /* */
- /* adx :: The horizontal offset of the accent. */
- /* */
- /* ady :: The vertical offset of the accent. */
- /* */
- /* bchar :: The base character's StandardEncoding charcode. */
- /* */
- /* achar :: The accent character's StandardEncoding charcode. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * t1operator_seac
+ *
+ * @Description:
+ * Implements the `seac' Type 1 operator for a Type 1 decoder.
+ *
+ * @Input:
+ * decoder ::
+ * The current CID decoder.
+ *
+ * asb ::
+ * The accent's side bearing.
+ *
+ * adx ::
+ * The horizontal offset of the accent.
+ *
+ * ady ::
+ * The vertical offset of the accent.
+ *
+ * bchar ::
+ * The base character's StandardEncoding charcode.
+ *
+ * achar ::
+ * The accent character's StandardEncoding charcode.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
t1operator_seac( T1_Decoder decoder,
FT_Pos asb,
@@ -399,24 +410,27 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_decoder_parse_charstrings */
- /* */
- /* <Description> */
- /* Parses a given Type 1 charstrings program. */
- /* */
- /* <Input> */
- /* decoder :: The current Type 1 decoder. */
- /* */
- /* charstring_base :: The base address of the charstring stream. */
- /* */
- /* charstring_len :: The length in bytes of the charstring stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * t1_decoder_parse_charstrings
+ *
+ * @Description:
+ * Parses a given Type 1 charstrings program.
+ *
+ * @Input:
+ * decoder ::
+ * The current Type 1 decoder.
+ *
+ * charstring_base ::
+ * The base address of the charstring stream.
+ *
+ * charstring_len ::
+ * The length in bytes of the charstring stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
t1_decoder_parse_charstrings( T1_Decoder decoder,
FT_Byte* charstring_base,
@@ -466,9 +480,6 @@
if ( decoder->buildchar && decoder->len_buildchar > 0 )
FT_ARRAY_ZERO( decoder->buildchar, decoder->len_buildchar );
- FT_TRACE4(( "\n"
- "Start charstring\n" ));
-
zone->base = charstring_base;
limit = zone->limit = charstring_base + charstring_len;
ip = zone->cursor = zone->base;
@@ -503,11 +514,11 @@
}
#endif
- /*********************************************************************/
- /* */
- /* Decode operator or operand */
- /* */
- /* */
+ /**********************************************************************
+ *
+ * Decode operator or operand
+ *
+ */
/* first of all, decompress operator or value */
switch ( *ip++ )
@@ -710,11 +721,11 @@
large_int = FALSE;
}
- /*********************************************************************/
- /* */
- /* Push value on stack, or process operator */
- /* */
- /* */
+ /**********************************************************************
+ *
+ * Push value on stack, or process operator
+ *
+ */
if ( op == op_none )
{
if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
@@ -752,16 +763,17 @@
subr_no = Fix2Int( top[1] );
arg_cnt = Fix2Int( top[0] );
- /***********************************************************/
- /* */
- /* remove all operands to callothersubr from the stack */
- /* */
- /* for handled othersubrs, where we know the number of */
- /* arguments, we increase the stack by the value of */
- /* known_othersubr_result_cnt */
- /* */
- /* for unhandled othersubrs the following pops adjust the */
- /* stack pointer as necessary */
+ /************************************************************
+ *
+ * remove all operands to callothersubr from the stack
+ *
+ * for handled othersubrs, where we know the number of
+ * arguments, we increase the stack by the value of
+ * known_othersubr_result_cnt
+ *
+ * for unhandled othersubrs the following pops adjust the
+ * stack pointer as necessary
+ */
if ( arg_cnt > top - decoder->stack )
goto Stack_Underflow;
@@ -1223,7 +1235,10 @@
/* the glyph's metrics (lsb + advance width), not load the */
/* rest of it; so exit immediately */
if ( builder->metrics_only )
+ {
+ FT_TRACE4(( "\n" ));
return FT_Err_Ok;
+ }
break;
@@ -1255,7 +1270,10 @@
/* the glyph's metrics (lsb + advance width), not load the */
/* rest of it; so exit immediately */
if ( builder->metrics_only )
+ {
+ FT_TRACE4(( "\n" ));
return FT_Err_Ok;
+ }
break;
@@ -1638,26 +1656,31 @@
return FT_THROW( Stack_Underflow );
}
-#else /* T1_CONFIG_OPTION_OLD_ENGINE */
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_decoder_parse_metrics */
- /* */
- /* <Description> */
- /* Parses a given Type 1 charstrings program to extract width */
- /* */
- /* <Input> */
- /* decoder :: The current Type 1 decoder. */
- /* */
- /* charstring_base :: The base address of the charstring stream. */
- /* */
- /* charstring_len :: The length in bytes of the charstring stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+
+#else /* !T1_CONFIG_OPTION_OLD_ENGINE */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * t1_decoder_parse_metrics
+ *
+ * @Description:
+ * Parses a given Type 1 charstrings program to extract width
+ *
+ * @Input:
+ * decoder ::
+ * The current Type 1 decoder.
+ *
+ * charstring_base ::
+ * The base address of the charstring stream.
+ *
+ * charstring_len ::
+ * The length in bytes of the charstring stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
t1_decoder_parse_metrics( T1_Decoder decoder,
FT_Byte* charstring_base,
@@ -1680,9 +1703,6 @@
builder->parse_state = T1_Parse_Start;
- FT_TRACE4(( "\n"
- "Start charstring: get width\n" ));
-
zone->base = charstring_base;
limit = zone->limit = charstring_base + charstring_len;
ip = zone->cursor = zone->base;
@@ -1703,11 +1723,11 @@
}
#endif
- /*********************************************************************/
- /* */
- /* Decode operator or operand */
- /* */
- /* */
+ /**********************************************************************
+ *
+ * Decode operator or operand
+ *
+ */
/* first of all, decompress operator or value */
switch ( *ip++ )
@@ -1817,11 +1837,11 @@
}
}
- /*********************************************************************/
- /* */
- /* Push value on stack, or process operator */
- /* */
- /* */
+ /**********************************************************************
+ *
+ * Push value on stack, or process operator
+ *
+ */
if ( op == op_none )
{
if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
@@ -1875,6 +1895,7 @@
/* we only want to compute the glyph's metrics */
/* (lsb + advance width), not load the rest of */
/* it; so exit immediately */
+ FT_TRACE4(( "\n" ));
return FT_Err_Ok;
case op_sbw:
@@ -1893,6 +1914,7 @@
/* we only want to compute the glyph's metrics */
/* (lsb + advance width), not load the rest of */
/* it; so exit immediately */
+ FT_TRACE4(( "\n" ));
return FT_Err_Ok;
default:
@@ -1917,7 +1939,8 @@
Stack_Underflow:
return FT_THROW( Stack_Underflow );
}
-#endif /* T1_CONFIG_OPTION_OLD_ENGINE */
+
+#endif /* !T1_CONFIG_OPTION_OLD_ENGINE */
/* initialize T1 decoder */
@@ -1934,7 +1957,7 @@
{
FT_ZERO( decoder );
- /* retrieve PSNames interface from list of current modules */
+ /* retrieve `psnames' interface from list of current modules */
{
FT_Service_PsCMaps psnames;
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h
index 1d9718d678e..1b5d6263d37 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1decode.h */
-/* */
-/* PostScript Type 1 decoding routines (specification). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1decode.h
+ *
+ * PostScript Type 1 decoding routines (specification).
+ *
+ * Copyright (C) 2000-2019 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 T1DECODE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/Jamfile b/Build/source/libs/freetype2/freetype-src/src/pshinter/Jamfile
index 3f5f0ae40e5..0e44c191489 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/pshinter Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/pshinter/module.mk b/Build/source/libs/freetype2/freetype-src/src/pshinter/module.mk
index 06707be3b4c..0a12a260e1c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.c b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.c
index b98077c62ef..0c5ae626999 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pshalgo.c */
-/* */
-/* PostScript hinting algorithm (body). */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshalgo.c
+ *
+ * PostScript hinting algorithm (body).
+ *
+ * Copyright (C) 2001-2019 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 <ft2build.h>
@@ -26,7 +26,7 @@
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pshalgo
+#define FT_COMPONENT pshalgo
#ifdef DEBUG_HINTER
@@ -53,8 +53,8 @@
psh_hint_overlap( PSH_Hint hint1,
PSH_Hint hint2 )
{
- return hint1->org_pos + hint1->org_len >= hint2->org_pos &&
- hint2->org_pos + hint2->org_len >= hint1->org_pos;
+ return ADD_INT( hint1->org_pos, hint1->org_len ) >= hint2->org_pos &&
+ ADD_INT( hint2->org_pos, hint2->org_len ) >= hint1->org_pos;
}
@@ -479,7 +479,7 @@
if ( dimension == 1 )
psh_blues_snap_stem( &globals->blues,
- hint->org_pos + hint->org_len,
+ ADD_INT( hint->org_pos, hint->org_len ),
hint->org_pos,
&align );
@@ -658,8 +658,8 @@
#if 0 /* not used for now, experimental */
/*
- * A variant to perform "light" hinting (i.e. FT_RENDER_MODE_LIGHT)
- * of stems
+ * A variant to perform "light" hinting (i.e. FT_RENDER_MODE_LIGHT)
+ * of stems
*/
static void
psh_hint_align_light( PSH_Hint hint,
@@ -703,7 +703,7 @@
if ( dimension == 1 )
psh_blues_snap_stem( &globals->blues,
- hint->org_pos + hint->org_len,
+ ADD_INT( hint->org_pos, hint->org_len ),
hint->org_pos,
&align );
@@ -1538,8 +1538,8 @@
PSH_Hint hint = sort[nn];
- if ( org_u >= hint->org_pos &&
- org_u <= hint->org_pos + hint->org_len )
+ if ( org_u >= hint->org_pos &&
+ org_u <= ADD_INT( hint->org_pos, hint->org_len ) )
{
point->hint = hint;
break;
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.h b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.h
index c50683fbec6..6859e95cd2d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshalgo.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pshalgo.h */
-/* */
-/* PostScript hinting algorithm (specification). */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshalgo.h
+ *
+ * PostScript hinting algorithm (specification).
+ *
+ * Copyright (C) 2001-2019 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 PSHALGO_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.c b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.c
index accc04921d0..b021e6e42a3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.c
@@ -1,25 +1,26 @@
-/***************************************************************************/
-/* */
-/* pshglob.c */
-/* */
-/* PostScript hinter global hinting management (body). */
-/* Inspired by the new auto-hinter module. */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshglob.c
+ *
+ * PostScript hinter global hinting management (body).
+ * Inspired by the new auto-hinter module.
+ *
+ * Copyright (C) 2001-2019 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 <ft2build.h>
#include FT_FREETYPE_H
#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_CALC_H
#include "pshglob.h"
#ifdef DEBUG_HINTER
@@ -568,7 +569,7 @@
for ( ; count > 0; count--, zone++ )
{
- delta = stem_top - zone->org_bottom;
+ delta = SUB_LONG( stem_top, zone->org_bottom );
if ( delta < -blues->blue_fuzz )
break;
@@ -590,7 +591,7 @@
for ( ; count > 0; count--, zone-- )
{
- delta = zone->org_top - stem_bot;
+ delta = SUB_LONG( zone->org_top, stem_bot );
if ( delta < -blues->blue_fuzz )
break;
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.h b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.h
index cf80bf40e64..0049d4c0bc8 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshglob.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pshglob.h */
-/* */
-/* PostScript hinter global hinting management. */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshglob.h
+ *
+ * PostScript hinter global hinting management.
+ *
+ * Copyright (C) 2001-2019 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 PSHGLOB_H_
@@ -36,27 +36,27 @@ FT_BEGIN_HEADER
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* @constant: */
- /* PS_GLOBALS_MAX_BLUE_ZONES */
- /* */
- /* @description: */
- /* The maximum number of blue zones in a font global hints structure. */
- /* See @PS_Globals_BluesRec. */
- /* */
+ /**************************************************************************
+ *
+ * @constant:
+ * PS_GLOBALS_MAX_BLUE_ZONES
+ *
+ * @description:
+ * The maximum number of blue zones in a font global hints structure.
+ * See @PS_Globals_BluesRec.
+ */
#define PS_GLOBALS_MAX_BLUE_ZONES 16
- /*************************************************************************/
- /* */
- /* @constant: */
- /* PS_GLOBALS_MAX_STD_WIDTHS */
- /* */
- /* @description: */
- /* The maximum number of standard and snap widths in either the */
- /* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
- /* */
+ /**************************************************************************
+ *
+ * @constant:
+ * PS_GLOBALS_MAX_STD_WIDTHS
+ *
+ * @description:
+ * The maximum number of standard and snap widths in either the
+ * horizontal or vertical direction. See @PS_Globals_WidthsRec.
+ */
#define PS_GLOBALS_MAX_STD_WIDTHS 16
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshinter.c b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshinter.c
index 0eedac452d2..16c3a0a1177 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshinter.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshinter.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pshinter.c */
-/* */
-/* FreeType PostScript Hinting module */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshinter.c
+ *
+ * FreeType PostScript Hinting module
+ *
+ * Copyright (C) 2001-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -22,7 +22,6 @@
#include "pshalgo.c"
#include "pshglob.c"
#include "pshmod.c"
-#include "pshpic.c"
#include "pshrec.c"
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.c b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.c
index 0b8f6f99b83..2d36ea2a6a6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.c
@@ -1,26 +1,25 @@
-/***************************************************************************/
-/* */
-/* pshmod.c */
-/* */
-/* FreeType PostScript hinter module implementation (body). */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshmod.c
+ *
+ * FreeType PostScript hinter module implementation (body).
+ *
+ * Copyright (C) 2001-2019 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 <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include "pshrec.h"
#include "pshalgo.h"
-#include "pshpic.h"
/* the Postscript Hinter module structure */
@@ -111,7 +110,7 @@
0x10000L,
0x20000L,
- &PSHINTER_INTERFACE_GET, /* module-specific interface */
+ &pshinter_interface, /* module-specific interface */
(FT_Module_Constructor)ps_hinter_init, /* module_init */
(FT_Module_Destructor) ps_hinter_done, /* module_done */
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.h b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.h
index 556de2fbc0e..ea8771308af 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshmod.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pshmod.h */
-/* */
-/* PostScript hinter module interface (specification). */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshmod.h
+ *
+ * PostScript hinter module interface (specification).
+ *
+ * Copyright (C) 2001-2019 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 PSHMOD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshnterr.h b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshnterr.h
index b9d02d2956a..fb9dbca2b1f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshnterr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshnterr.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* pshnterr.h */
-/* */
-/* PS Hinter error codes (specification only). */
-/* */
-/* Copyright 2003-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the PSHinter error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * pshnterr.h
+ *
+ * PS Hinter error codes (specification only).
+ *
+ * Copyright (C) 2003-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the PSHinter error enumeration constants.
+ *
+ */
#ifndef PSHNTERR_H_
#define PSHNTERR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.c b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.c
deleted file mode 100644
index 465ad31885b..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************/
-/* */
-/* pshpic.c */
-/* */
-/* The FreeType position independent code services for pshinter module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "pshpic.h"
-#include "pshnterr.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from pshmod.c */
- void
- FT_Init_Class_pshinter_interface( FT_Library library,
- PSHinter_Interface* clazz );
-
- void
- pshinter_module_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->pshinter )
- {
- FT_FREE( pic_container->pshinter );
- pic_container->pshinter = NULL;
- }
- }
-
-
- FT_Error
- pshinter_module_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- PSHinterPIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->pshinter = container;
-
- /* add call to initialization function when you add new scripts */
- FT_Init_Class_pshinter_interface(
- library, &container->pshinter_interface );
-
- if ( error )
- pshinter_module_class_pic_free( library );
-
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.h b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.h
deleted file mode 100644
index 4469ba87c80..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshpic.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************/
-/* */
-/* pshpic.h */
-/* */
-/* The FreeType position independent code services for pshinter module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 PSHPIC_H_
-#define PSHPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define PSHINTER_INTERFACE_GET pshinter_interface
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#include FT_INTERNAL_POSTSCRIPT_HINTS_H
-
-FT_BEGIN_HEADER
-
- typedef struct PSHinterPIC_
- {
- PSHinter_Interface pshinter_interface;
-
- } PSHinterPIC;
-
-
-#define GET_PIC( lib ) ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) )
-
-#define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface )
-
- /* see pshpic.c for the implementation */
- void
- pshinter_module_class_pic_free( FT_Library library );
-
- FT_Error
- pshinter_module_class_pic_init( FT_Library library );
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* PSHPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.c b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.c
index 6648d13d60f..9dd09efe4ca 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pshrec.c */
-/* */
-/* FreeType PostScript hints recorder (body). */
-/* */
-/* Copyright 2001-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pshrec.c
+ *
+ * FreeType PostScript hints recorder (body).
+ *
+ * Copyright (C) 2001-2019 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 <ft2build.h>
@@ -28,7 +28,7 @@
#include "pshnterr.h"
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pshrec
+#define FT_COMPONENT pshrec
#ifdef DEBUG_HINTER
PS_Hints ps_debug_hints = NULL;
@@ -666,7 +666,7 @@
if ( len == -21 )
{
flags |= PS_HINT_FLAG_BOTTOM;
- pos += len;
+ pos = ADD_INT( pos, len );
}
len = 0;
}
@@ -1187,7 +1187,7 @@
/* compute integer stem positions in font units */
for ( n = 0; n < count * 2; n++ )
{
- y += coords[n];
+ y = ADD_LONG( y, coords[n] );
stems[n] = FIXED_TO_INT( y );
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.h b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.h
index 7e3dfe0d538..02cc2102ec3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.h
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/pshrec.h
@@ -1,31 +1,31 @@
-/***************************************************************************/
-/* */
-/* pshrec.h */
-/* */
-/* Postscript (Type1/Type2) hints recorder (specification). */
-/* */
-/* Copyright 2001-2018 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 functions defined here are called from the Type 1, CID and CFF */
- /* font drivers to record the hints of a given character/glyph. */
- /* */
- /* The hints are recorded in a unified format, and are later processed */
- /* by the `optimizer' and `fitter' to adjust the outlines to the pixel */
- /* grid. */
- /* */
- /**************************************************************************/
+/****************************************************************************
+ *
+ * pshrec.h
+ *
+ * Postscript (Type1/Type2) hints recorder (specification).
+ *
+ * Copyright (C) 2001-2019 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 functions defined here are called from the Type 1, CID and CFF
+ * font drivers to record the hints of a given character/glyph.
+ *
+ * The hints are recorded in a unified format, and are later processed
+ * by the `optimizer' and `fitter' to adjust the outlines to the pixel
+ * grid.
+ *
+ */
#ifndef PSHREC_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/pshinter/rules.mk b/Build/source/libs/freetype2/freetype-src/src/pshinter/rules.mk
index 966690efc20..58227d10f25 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pshinter/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/pshinter/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -31,7 +31,6 @@ PSHINTER_COMPILE := $(CC) $(ANSIFLAGS) \
PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshalgo.c \
$(PSHINTER_DIR)/pshglob.c \
$(PSHINTER_DIR)/pshmod.c \
- $(PSHINTER_DIR)/pshpic.c \
$(PSHINTER_DIR)/pshrec.c
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/Jamfile b/Build/source/libs/freetype2/freetype-src/src/psnames/Jamfile
index a0fd37397a3..75978a87878 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/psnames Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/psnames/module.mk b/Build/source/libs/freetype2/freetype-src/src/psnames/module.mk
index 410f48a191b..0806a318a73 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c b/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
index 8929ebe751d..0ec440e67b4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psmodule.c */
-/* */
-/* PSNames module implementation (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psmodule.c
+ *
+ * psnames module implementation (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -24,16 +24,16 @@
#include "psmodule.h"
/*
- * The file `pstables.h' with its arrays and its function
- * `ft_get_adobe_glyph_index' is useful for other projects also (for
- * example, `pdfium' is using it). However, if used as a C++ header,
- * including it in two different source files makes it necessary to use
- * `extern const' for the declaration of its arrays, otherwise the data
- * would be duplicated as mandated by the C++ standard.
+ * The file `pstables.h' with its arrays and its function
+ * `ft_get_adobe_glyph_index' is useful for other projects also (for
+ * example, `pdfium' is using it). However, if used as a C++ header,
+ * including it in two different source files makes it necessary to use
+ * `extern const' for the declaration of its arrays, otherwise the data
+ * would be duplicated as mandated by the C++ standard.
*
- * For this reason, we use `DEFINE_PS_TABLES' to guard the function
- * definitions, and `DEFINE_PS_TABLES_DATA' to provide both proper array
- * declarations and definitions.
+ * For this reason, we use `DEFINE_PS_TABLES' to guard the function
+ * definitions, and `DEFINE_PS_TABLES_DATA' to provide both proper array
+ * declarations and definitions.
*/
#include "pstables.h"
#define DEFINE_PS_TABLES
@@ -41,7 +41,6 @@
#include "pstables.h"
#include "psnamerr.h"
-#include "pspic.h"
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
@@ -393,7 +392,9 @@
/* Reallocate if the number of used entries is much smaller. */
if ( count < num_glyphs / 2 )
{
- (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count );
+ (void)FT_RENEW_ARRAY( table->maps,
+ num_glyphs + EXTRA_GLYPH_LIST_SIZE,
+ count );
error = FT_Err_Ok;
}
@@ -577,28 +578,16 @@
FT_DEFINE_SERVICEDESCREC1(
pscmaps_services,
- FT_SERVICE_ID_POSTSCRIPT_CMAPS, &PSCMAPS_INTERFACE_GET )
+ FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface )
static FT_Pointer
psnames_get_service( FT_Module module,
const char* service_id )
{
- /* PSCMAPS_SERVICES_GET dereferences `library' in PIC mode */
-#ifdef FT_CONFIG_OPTION_PIC
- FT_Library library;
-
-
- if ( !module )
- return NULL;
- library = module->library;
- if ( !library )
- return NULL;
-#else
FT_UNUSED( module );
-#endif
- return ft_service_list_lookup( PSCMAPS_SERVICES_GET, service_id );
+ return ft_service_list_lookup( pscmaps_services, service_id );
}
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
@@ -621,7 +610,7 @@
0x20000L, /* driver requires FreeType 2 or above */
PUT_PS_NAMES_SERVICE(
- (void*)&PSCMAPS_INTERFACE_GET ), /* module specific interface */
+ (void*)&pscmaps_interface ), /* module specific interface */
(FT_Module_Constructor)NULL, /* module_init */
(FT_Module_Destructor) NULL, /* module_done */
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.h b/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.h
index 3e94f8b437e..0df9a7d889c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* psmodule.h */
-/* */
-/* High-level PSNames module interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psmodule.h
+ *
+ * High-level psnames module interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 PSMODULE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/psnamerr.h b/Build/source/libs/freetype2/freetype-src/src/psnames/psnamerr.h
index 14eb76c99cf..67ab1765d38 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/psnamerr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/psnamerr.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* psnamerr.h */
-/* */
-/* PS names module error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the PS names module error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * psnamerr.h
+ *
+ * PS names module error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the PS names module error enumeration
+ * constants.
+ *
+ */
#ifndef PSNAMERR_H_
#define PSNAMERR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/psnames.c b/Build/source/libs/freetype2/freetype-src/src/psnames/psnames.c
index febb80d594e..4722f988317 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/psnames.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/psnames.c
@@ -1,26 +1,25 @@
-/***************************************************************************/
-/* */
-/* psnames.c */
-/* */
-/* FreeType PSNames module component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * psnames.c
+ *
+ * FreeType psnames module component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "psmodule.c"
-#include "pspic.c"
/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/pspic.c b/Build/source/libs/freetype2/freetype-src/src/psnames/pspic.c
deleted file mode 100644
index 85a06f36037..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/pspic.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/***************************************************************************/
-/* */
-/* pspic.c */
-/* */
-/* The FreeType position independent code services for psnames module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "pspic.h"
-#include "psnamerr.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from psmodule.c */
- FT_Error
- FT_Create_Class_pscmaps_services( FT_Library library,
- FT_ServiceDescRec** output_class );
- void
- FT_Destroy_Class_pscmaps_services( FT_Library library,
- FT_ServiceDescRec* clazz );
-
- void
- FT_Init_Class_pscmaps_interface( FT_Library library,
- FT_Service_PsCMapsRec* clazz );
-
-
- void
- psnames_module_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->psnames )
- {
- PSModulePIC* container = (PSModulePIC*)pic_container->psnames;
-
-
- if ( container->pscmaps_services )
- FT_Destroy_Class_pscmaps_services( library,
- container->pscmaps_services );
- container->pscmaps_services = NULL;
- FT_FREE( container );
- pic_container->psnames = NULL;
- }
- }
-
-
- FT_Error
- psnames_module_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- PSModulePIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->psnames = container;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- error = FT_Create_Class_pscmaps_services(
- library, &container->pscmaps_services );
- if ( error )
- goto Exit;
- FT_Init_Class_pscmaps_interface( library,
- &container->pscmaps_interface );
-
- Exit:
- if ( error )
- psnames_module_class_pic_free( library );
- return error;
- }
-
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/pspic.h b/Build/source/libs/freetype2/freetype-src/src/psnames/pspic.h
deleted file mode 100644
index 889780cc032..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/pspic.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************/
-/* */
-/* pspic.h */
-/* */
-/* The FreeType position independent code services for psnames module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 PSPIC_H_
-#define PSPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define PSCMAPS_SERVICES_GET pscmaps_services
-#define PSCMAPS_INTERFACE_GET pscmaps_interface
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#include FT_SERVICE_POSTSCRIPT_CMAPS_H
-
-
-FT_BEGIN_HEADER
-
- typedef struct PSModulePIC_
- {
- FT_ServiceDescRec* pscmaps_services;
- FT_Service_PsCMapsRec pscmaps_interface;
-
- } PSModulePIC;
-
-
-#define GET_PIC( lib ) \
- ( (PSModulePIC*)((lib)->pic_container.psnames) )
-#define PSCMAPS_SERVICES_GET ( GET_PIC( library )->pscmaps_services )
-#define PSCMAPS_INTERFACE_GET ( GET_PIC( library )->pscmaps_interface )
-
-
- /* see pspic.c for the implementation */
- void
- psnames_module_class_pic_free( FT_Library library );
-
- FT_Error
- psnames_module_class_pic_init( FT_Library library );
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* PSPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/pstables.h b/Build/source/libs/freetype2/freetype-src/src/psnames/pstables.h
index 79545ee0396..c0139bbc601 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/pstables.h
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/pstables.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* pstables.h */
-/* */
-/* PostScript glyph names. */
-/* */
-/* Copyright 2005-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pstables.h
+ *
+ * PostScript glyph names.
+ *
+ * Copyright (C) 2005-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
/* This file has been generated automatically -- do not edit! */
@@ -609,12 +609,12 @@
/*
- * This table is a compressed version of the Adobe Glyph List (AGL),
- * optimized for efficient searching. It has been generated by the
- * `glnames.py' python script located in the `src/tools' directory.
+ * This table is a compressed version of the Adobe Glyph List (AGL),
+ * optimized for efficient searching. It has been generated by the
+ * `glnames.py' python script located in the `src/tools' directory.
*
- * The lookup function to get the Unicode value for a given string
- * is defined below the table.
+ * The lookup function to get the Unicode value for a given string
+ * is defined below the table.
*/
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
@@ -4137,7 +4137,7 @@
#ifdef DEFINE_PS_TABLES
/*
- * This function searches the compressed table efficiently.
+ * This function searches the compressed table efficiently.
*/
static unsigned long
ft_get_adobe_glyph_index( const char* name,
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/rules.mk b/Build/source/libs/freetype2/freetype-src/src/psnames/rules.mk
index 4d629d841c8..dcc203e3910 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/rules.mk
@@ -1,9 +1,9 @@
#
-# FreeType 2 PSNames driver configuration rules
+# FreeType 2 psnames driver configuration rules
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -13,7 +13,7 @@
# fully.
-# PSNames driver directory
+# psnames driver directory
#
PSNAMES_DIR := $(SRC_DIR)/psnames
@@ -26,20 +26,19 @@ PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \
$(FT_CFLAGS)
-# PSNames driver sources (i.e., C files)
+# psnames driver sources (i.e., C files)
#
-PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c \
- $(PSNAMES_DIR)/pspic.c
+PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
-# PSNames driver headers
+# psnames driver headers
#
PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
$(PSNAMES_DIR)/psnamerr.h \
$(PSNAMES_DIR)/pstables.h
-# PSNames driver object(s)
+# psnames driver object(s)
#
# PSNAMES_DRV_OBJ_M is used during `multi' builds
# PSNAMES_DRV_OBJ_S is used during `single' builds
@@ -47,19 +46,19 @@ PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)
PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
-# PSNames driver source file for single build
+# psnames driver source file for single build
#
PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c
-# PSNames driver - single object
+# psnames driver - single object
#
$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
$(FREETYPE_H) $(PSNAMES_DRV_H)
$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))
-# PSNames driver - multiple objects
+# psnames driver - multiple objects
#
$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/Jamfile b/Build/source/libs/freetype2/freetype-src/src/raster/Jamfile
index 838e7ef57ef..3990c05cd80 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/raster Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/raster/ftmisc.h b/Build/source/libs/freetype2/freetype-src/src/raster/ftmisc.h
index 7e401190711..a246569e3be 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/ftmisc.h
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/ftmisc.h
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* ftmisc.h */
-/* */
-/* Miscellaneous macros for stand-alone rasterizer (specification */
-/* only). */
-/* */
-/* Copyright 2005-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used */
-/* modified and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /***************************************************/
- /* */
- /* This file is *not* portable! You have to adapt */
- /* its definitions to your platform. */
- /* */
- /***************************************************/
+/****************************************************************************
+ *
+ * ftmisc.h
+ *
+ * Miscellaneous macros for stand-alone rasterizer (specification
+ * only).
+ *
+ * Copyright (C) 2005-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used
+ * modified and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /****************************************************
+ *
+ * This file is *not* portable! You have to adapt
+ * its definitions to your platform.
+ *
+ */
#ifndef FTMISC_H_
#define FTMISC_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.c b/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.c
index 4354730d54e..798a72d02a1 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.c
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.c
@@ -1,51 +1,51 @@
-/***************************************************************************/
-/* */
-/* ftraster.c */
-/* */
-/* The FreeType glyph rasterizer (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This file can be compiled without the rest of the FreeType engine, by */
- /* defining the STANDALONE_ macro when compiling it. You also need to */
- /* put the files `ftimage.h' and `ftmisc.h' into the $(incdir) */
- /* directory. Typically, you should do something like */
- /* */
- /* - copy `src/raster/ftraster.c' (this file) to your current directory */
- /* */
- /* - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h' to your */
- /* current directory */
- /* */
- /* - compile `ftraster' with the STANDALONE_ macro defined, as in */
- /* */
- /* cc -c -DSTANDALONE_ ftraster.c */
- /* */
- /* The renderer can be initialized with a call to */
- /* `ft_standard_raster.raster_new'; a bitmap can be generated */
- /* with a call to `ft_standard_raster.raster_render'. */
- /* */
- /* See the comments and documentation in the file `ftimage.h' for more */
- /* details on how the raster works. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This is a rewrite of the FreeType 1.x scan-line converter */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftraster.c
+ *
+ * The FreeType glyph rasterizer (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * This file can be compiled without the rest of the FreeType engine, by
+ * defining the STANDALONE_ macro when compiling it. You also need to
+ * put the files `ftimage.h' and `ftmisc.h' into the $(incdir)
+ * directory. Typically, you should do something like
+ *
+ * - copy `src/raster/ftraster.c' (this file) to your current directory
+ *
+ * - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h' to your
+ * current directory
+ *
+ * - compile `ftraster' with the STANDALONE_ macro defined, as in
+ *
+ * cc -c -DSTANDALONE_ ftraster.c
+ *
+ * The renderer can be initialized with a call to
+ * `ft_standard_raster.raster_new'; a bitmap can be generated
+ * with a call to `ft_standard_raster.raster_render'.
+ *
+ * See the comments and documentation in the file `ftimage.h' for more
+ * details on how the raster works.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This is a rewrite of the FreeType 1.x scan-line converter
+ *
+ */
#ifdef STANDALONE_
@@ -65,82 +65,81 @@
#include <ft2build.h>
#include "ftraster.h"
#include FT_INTERNAL_CALC_H /* for FT_MulDiv and FT_MulDiv_No_Round */
-
-#include "rastpic.h"
+#include FT_OUTLINE_H /* for FT_Outline_Get_CBox */
#endif /* !STANDALONE_ */
- /*************************************************************************/
- /* */
- /* A simple technical note on how the raster works */
- /* ----------------------------------------------- */
- /* */
- /* Converting an outline into a bitmap is achieved in several steps: */
- /* */
- /* 1 - Decomposing the outline into successive `profiles'. Each */
- /* profile is simply an array of scanline intersections on a given */
- /* dimension. A profile's main attributes are */
- /* */
- /* o its scanline position boundaries, i.e. `Ymin' and `Ymax' */
- /* */
- /* o an array of intersection coordinates for each scanline */
- /* between `Ymin' and `Ymax' */
- /* */
- /* o a direction, indicating whether it was built going `up' or */
- /* `down', as this is very important for filling rules */
- /* */
- /* o its drop-out mode */
- /* */
- /* 2 - Sweeping the target map's scanlines in order to compute segment */
- /* `spans' which are then filled. Additionally, this pass */
- /* performs drop-out control. */
- /* */
- /* The outline data is parsed during step 1 only. The profiles are */
- /* built from the bottom of the render pool, used as a stack. The */
- /* following graphics shows the profile list under construction: */
- /* */
- /* __________________________________________________________ _ _ */
- /* | | | | | */
- /* | profile | coordinates for | profile | coordinates for |--> */
- /* | 1 | profile 1 | 2 | profile 2 |--> */
- /* |_________|_________________|_________|_________________|__ _ _ */
- /* */
- /* ^ ^ */
- /* | | */
- /* start of render pool top */
- /* */
- /* The top of the profile stack is kept in the `top' variable. */
- /* */
- /* As you can see, a profile record is pushed on top of the render */
- /* pool, which is then followed by its coordinates/intersections. If */
- /* a change of direction is detected in the outline, a new profile is */
- /* generated until the end of the outline. */
- /* */
- /* Note that when all profiles have been generated, the function */
- /* Finalize_Profile_Table() is used to record, for each profile, its */
- /* bottom-most scanline as well as the scanline above its upmost */
- /* boundary. These positions are called `y-turns' because they (sort */
- /* of) correspond to local extrema. They are stored in a sorted list */
- /* built from the top of the render pool as a downwards stack: */
- /* */
- /* _ _ _______________________________________ */
- /* | | */
- /* <--| sorted list of | */
- /* <--| extrema scanlines | */
- /* _ _ __________________|____________________| */
- /* */
- /* ^ ^ */
- /* | | */
- /* maxBuff sizeBuff = end of pool */
- /* */
- /* This list is later used during the sweep phase in order to */
- /* optimize performance (see technical note on the sweep below). */
- /* */
- /* Of course, the raster detects whether the two stacks collide and */
- /* handles the situation properly. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * A simple technical note on how the raster works
+ * -----------------------------------------------
+ *
+ * Converting an outline into a bitmap is achieved in several steps:
+ *
+ * 1 - Decomposing the outline into successive `profiles'. Each
+ * profile is simply an array of scanline intersections on a given
+ * dimension. A profile's main attributes are
+ *
+ * o its scanline position boundaries, i.e. `Ymin' and `Ymax'
+ *
+ * o an array of intersection coordinates for each scanline
+ * between `Ymin' and `Ymax'
+ *
+ * o a direction, indicating whether it was built going `up' or
+ * `down', as this is very important for filling rules
+ *
+ * o its drop-out mode
+ *
+ * 2 - Sweeping the target map's scanlines in order to compute segment
+ * `spans' which are then filled. Additionally, this pass
+ * performs drop-out control.
+ *
+ * The outline data is parsed during step 1 only. The profiles are
+ * built from the bottom of the render pool, used as a stack. The
+ * following graphics shows the profile list under construction:
+ *
+ * __________________________________________________________ _ _
+ * | | | | |
+ * | profile | coordinates for | profile | coordinates for |-->
+ * | 1 | profile 1 | 2 | profile 2 |-->
+ * |_________|_________________|_________|_________________|__ _ _
+ *
+ * ^ ^
+ * | |
+ * start of render pool top
+ *
+ * The top of the profile stack is kept in the `top' variable.
+ *
+ * As you can see, a profile record is pushed on top of the render
+ * pool, which is then followed by its coordinates/intersections. If
+ * a change of direction is detected in the outline, a new profile is
+ * generated until the end of the outline.
+ *
+ * Note that when all profiles have been generated, the function
+ * Finalize_Profile_Table() is used to record, for each profile, its
+ * bottom-most scanline as well as the scanline above its upmost
+ * boundary. These positions are called `y-turns' because they (sort
+ * of) correspond to local extrema. They are stored in a sorted list
+ * built from the top of the render pool as a downwards stack:
+ *
+ * _ _ _______________________________________
+ * | |
+ * <--| sorted list of |
+ * <--| extrema scanlines |
+ * _ _ __________________|____________________|
+ *
+ * ^ ^
+ * | |
+ * maxBuff sizeBuff = end of pool
+ *
+ * This list is later used during the sweep phase in order to
+ * optimize performance (see technical note on the sweep below).
+ *
+ * Of course, the raster detects whether the two stacks collide and
+ * handles the situation properly.
+ *
+ */
/*************************************************************************/
@@ -163,14 +162,14 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_raster
+#define FT_COMPONENT raster
#ifdef STANDALONE_
@@ -452,9 +451,9 @@
#define CEILING( x ) ( ( (x) + ras.precision - 1 ) & -ras.precision )
#define TRUNC( x ) ( (Long)(x) >> ras.precision_bits )
#define FRAC( x ) ( (x) & ( ras.precision - 1 ) )
-#define SCALED( x ) ( ( (x) < 0 ? -( -(x) << ras.scale_shift ) \
- : ( (x) << ras.scale_shift ) ) \
- - ras.precision_half )
+
+ /* scale and shift grid to pixel centers */
+#define SCALED( x ) ( (x) * ras.precision_scale - ras.precision_half )
#define IS_BOTTOM_OVERSHOOT( x ) \
(Bool)( CEILING( x ) - x >= ras.precision_half )
@@ -476,13 +475,10 @@
Int precision_bits; /* precision related variables */
Int precision;
Int precision_half;
- Int precision_shift;
+ Int precision_scale;
Int precision_step;
Int precision_jitter;
- Int scale_shift; /* == precision_shift for bitmaps */
- /* == precision_shift+1 for pixmaps */
-
PLong buff; /* The profiles buffer */
PLong sizeBuff; /* Render pool size */
PLong maxBuff; /* Profiles buffer size */
@@ -495,8 +491,7 @@
TPoint* arc; /* current Bezier arc pointer */
UShort bWidth; /* target bitmap width */
- PByte bTarget; /* target bitmap buffer */
- PByte gTarget; /* target pixmap buffer */
+ PByte bOrigin; /* target bitmap bottom-left origin */
Long lastX, lastY;
Long minY, maxY;
@@ -519,8 +514,6 @@
FT_Outline outline;
Long traceOfs; /* current offset in target bitmap */
- Long traceG; /* current offset in target pixmap */
-
Short traceIncr; /* sweep's increment in target bitmap */
/* dispatch variables */
@@ -572,18 +565,19 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Set_High_Precision */
- /* */
- /* <Description> */
- /* Set precision variables according to param flag. */
- /* */
- /* <Input> */
- /* High :: Set to True for high precision (typically for ppem < 24), */
- /* false otherwise. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Set_High_Precision
+ *
+ * @Description:
+ * Set precision variables according to param flag.
+ *
+ * @Input:
+ * High ::
+ * Set to True for high precision (typically for ppem < 24),
+ * false otherwise.
+ */
static void
Set_High_Precision( RAS_ARGS Int High )
{
@@ -625,29 +619,31 @@
FT_TRACE6(( "Set_High_Precision(%s)\n", High ? "true" : "false" ));
ras.precision = 1 << ras.precision_bits;
- ras.precision_half = ras.precision / 2;
- ras.precision_shift = ras.precision_bits - Pixel_Bits;
+ ras.precision_half = ras.precision >> 1;
+ ras.precision_scale = ras.precision >> Pixel_Bits;
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* New_Profile */
- /* */
- /* <Description> */
- /* Create a new profile in the render pool. */
- /* */
- /* <Input> */
- /* aState :: The state/orientation of the new profile. */
- /* */
- /* overshoot :: Whether the profile's unrounded start position */
- /* differs by at least a half pixel. */
- /* */
- /* <Return> */
- /* SUCCESS on success. FAILURE in case of overflow or of incoherent */
- /* profile. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * New_Profile
+ *
+ * @Description:
+ * Create a new profile in the render pool.
+ *
+ * @Input:
+ * aState ::
+ * The state/orientation of the new profile.
+ *
+ * overshoot ::
+ * Whether the profile's unrounded start position
+ * differs by at least a half pixel.
+ *
+ * @Return:
+ * SUCCESS on success. FAILURE in case of overflow or of incoherent
+ * profile.
+ */
static Bool
New_Profile( RAS_ARGS TStates aState,
Bool overshoot )
@@ -706,21 +702,22 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* End_Profile */
- /* */
- /* <Description> */
- /* Finalize the current profile. */
- /* */
- /* <Input> */
- /* overshoot :: Whether the profile's unrounded end position differs */
- /* by at least a half pixel. */
- /* */
- /* <Return> */
- /* SUCCESS on success. FAILURE in case of overflow or incoherency. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * End_Profile
+ *
+ * @Description:
+ * Finalize the current profile.
+ *
+ * @Input:
+ * overshoot ::
+ * Whether the profile's unrounded end position differs
+ * by at least a half pixel.
+ *
+ * @Return:
+ * SUCCESS on success. FAILURE in case of overflow or incoherency.
+ */
static Bool
End_Profile( RAS_ARGS Bool overshoot )
{
@@ -778,21 +775,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Insert_Y_Turn */
- /* */
- /* <Description> */
- /* Insert a salient into the sorted list placed on top of the render */
- /* pool. */
- /* */
- /* <Input> */
- /* New y scanline position. */
- /* */
- /* <Return> */
- /* SUCCESS on success. FAILURE in case of overflow. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Insert_Y_Turn
+ *
+ * @Description:
+ * Insert a salient into the sorted list placed on top of the render
+ * pool.
+ *
+ * @Input:
+ * New y scanline position.
+ *
+ * @Return:
+ * SUCCESS on success. FAILURE in case of overflow.
+ */
static Bool
Insert_Y_Turn( RAS_ARGS Int y )
{
@@ -834,17 +831,17 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Finalize_Profile_Table */
- /* */
- /* <Description> */
- /* Adjust all links in the profiles list. */
- /* */
- /* <Return> */
- /* SUCCESS on success. FAILURE in case of overflow. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Finalize_Profile_Table
+ *
+ * @Description:
+ * Adjust all links in the profiles list.
+ *
+ * @Return:
+ * SUCCESS on success. FAILURE in case of overflow.
+ */
static Bool
Finalize_Profile_Table( RAS_ARG )
{
@@ -894,22 +891,22 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Split_Conic */
- /* */
- /* <Description> */
- /* Subdivide one conic Bezier into two joint sub-arcs in the Bezier */
- /* stack. */
- /* */
- /* <Input> */
- /* None (subdivided Bezier is taken from the top of the stack). */
- /* */
- /* <Note> */
- /* This routine is the `beef' of this component. It is _the_ inner */
- /* loop that should be optimized to hell to get the best performance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Split_Conic
+ *
+ * @Description:
+ * Subdivide one conic Bezier into two joint sub-arcs in the Bezier
+ * stack.
+ *
+ * @Input:
+ * None (subdivided Bezier is taken from the top of the stack).
+ *
+ * @Note:
+ * This routine is the `beef' of this component. It is _the_ inner
+ * loop that should be optimized to hell to get the best performance.
+ */
static void
Split_Conic( TPoint* base )
{
@@ -933,20 +930,20 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Split_Cubic */
- /* */
- /* <Description> */
- /* Subdivide a third-order Bezier arc into two joint sub-arcs in the */
- /* Bezier stack. */
- /* */
- /* <Note> */
- /* This routine is the `beef' of the component. It is one of _the_ */
- /* inner loops that should be optimized like hell to get the best */
- /* performance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Split_Cubic
+ *
+ * @Description:
+ * Subdivide a third-order Bezier arc into two joint sub-arcs in the
+ * Bezier stack.
+ *
+ * @Note:
+ * This routine is the `beef' of the component. It is one of _the_
+ * inner loops that should be optimized like hell to get the best
+ * performance.
+ */
static void
Split_Cubic( TPoint* base )
{
@@ -975,31 +972,37 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Line_Up */
- /* */
- /* <Description> */
- /* Compute the x-coordinates of an ascending line segment and store */
- /* them in the render pool. */
- /* */
- /* <Input> */
- /* x1 :: The x-coordinate of the segment's start point. */
- /* */
- /* y1 :: The y-coordinate of the segment's start point. */
- /* */
- /* x2 :: The x-coordinate of the segment's end point. */
- /* */
- /* y2 :: The y-coordinate of the segment's end point. */
- /* */
- /* miny :: A lower vertical clipping bound value. */
- /* */
- /* maxy :: An upper vertical clipping bound value. */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Line_Up
+ *
+ * @Description:
+ * Compute the x-coordinates of an ascending line segment and store
+ * them in the render pool.
+ *
+ * @Input:
+ * x1 ::
+ * The x-coordinate of the segment's start point.
+ *
+ * y1 ::
+ * The y-coordinate of the segment's start point.
+ *
+ * x2 ::
+ * The x-coordinate of the segment's end point.
+ *
+ * y2 ::
+ * The y-coordinate of the segment's end point.
+ *
+ * miny ::
+ * A lower vertical clipping bound value.
+ *
+ * maxy ::
+ * An upper vertical clipping bound value.
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow.
+ */
static Bool
Line_Up( RAS_ARGS Long x1,
Long y1,
@@ -1114,31 +1117,37 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Line_Down */
- /* */
- /* <Description> */
- /* Compute the x-coordinates of an descending line segment and store */
- /* them in the render pool. */
- /* */
- /* <Input> */
- /* x1 :: The x-coordinate of the segment's start point. */
- /* */
- /* y1 :: The y-coordinate of the segment's start point. */
- /* */
- /* x2 :: The x-coordinate of the segment's end point. */
- /* */
- /* y2 :: The y-coordinate of the segment's end point. */
- /* */
- /* miny :: A lower vertical clipping bound value. */
- /* */
- /* maxy :: An upper vertical clipping bound value. */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Line_Down
+ *
+ * @Description:
+ * Compute the x-coordinates of an descending line segment and store
+ * them in the render pool.
+ *
+ * @Input:
+ * x1 ::
+ * The x-coordinate of the segment's start point.
+ *
+ * y1 ::
+ * The y-coordinate of the segment's start point.
+ *
+ * x2 ::
+ * The x-coordinate of the segment's end point.
+ *
+ * y2 ::
+ * The y-coordinate of the segment's end point.
+ *
+ * miny ::
+ * A lower vertical clipping bound value.
+ *
+ * maxy ::
+ * An upper vertical clipping bound value.
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow.
+ */
static Bool
Line_Down( RAS_ARGS Long x1,
Long y1,
@@ -1165,27 +1174,31 @@
typedef void (*TSplitter)( TPoint* base );
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Bezier_Up */
- /* */
- /* <Description> */
- /* Compute the x-coordinates of an ascending Bezier arc and store */
- /* them in the render pool. */
- /* */
- /* <Input> */
- /* degree :: The degree of the Bezier arc (either 2 or 3). */
- /* */
- /* splitter :: The function to split Bezier arcs. */
- /* */
- /* miny :: A lower vertical clipping bound value. */
- /* */
- /* maxy :: An upper vertical clipping bound value. */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Bezier_Up
+ *
+ * @Description:
+ * Compute the x-coordinates of an ascending Bezier arc and store
+ * them in the render pool.
+ *
+ * @Input:
+ * degree ::
+ * The degree of the Bezier arc (either 2 or 3).
+ *
+ * splitter ::
+ * The function to split Bezier arcs.
+ *
+ * miny ::
+ * A lower vertical clipping bound value.
+ *
+ * maxy ::
+ * An upper vertical clipping bound value.
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow.
+ */
static Bool
Bezier_Up( RAS_ARGS Int degree,
TSplitter splitter,
@@ -1298,27 +1311,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Bezier_Down */
- /* */
- /* <Description> */
- /* Compute the x-coordinates of an descending Bezier arc and store */
- /* them in the render pool. */
- /* */
- /* <Input> */
- /* degree :: The degree of the Bezier arc (either 2 or 3). */
- /* */
- /* splitter :: The function to split Bezier arcs. */
- /* */
- /* miny :: A lower vertical clipping bound value. */
- /* */
- /* maxy :: An upper vertical clipping bound value. */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Bezier_Down
+ *
+ * @Description:
+ * Compute the x-coordinates of an descending Bezier arc and store
+ * them in the render pool.
+ *
+ * @Input:
+ * degree ::
+ * The degree of the Bezier arc (either 2 or 3).
+ *
+ * splitter ::
+ * The function to split Bezier arcs.
+ *
+ * miny ::
+ * A lower vertical clipping bound value.
+ *
+ * maxy ::
+ * An upper vertical clipping bound value.
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow.
+ */
static Bool
Bezier_Down( RAS_ARGS Int degree,
TSplitter splitter,
@@ -1347,25 +1364,27 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Line_To */
- /* */
- /* <Description> */
- /* Inject a new line segment and adjust the Profiles list. */
- /* */
- /* <Input> */
- /* x :: The x-coordinate of the segment's end point (its start point */
- /* is stored in `lastX'). */
- /* */
- /* y :: The y-coordinate of the segment's end point (its start point */
- /* is stored in `lastY'). */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow or incorrect */
- /* profile. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Line_To
+ *
+ * @Description:
+ * Inject a new line segment and adjust the Profiles list.
+ *
+ * @Input:
+ * x ::
+ * The x-coordinate of the segment's end point (its start point
+ * is stored in `lastX').
+ *
+ * y ::
+ * The y-coordinate of the segment's end point (its start point
+ * is stored in `lastY').
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow or incorrect
+ * profile.
+ */
static Bool
Line_To( RAS_ARGS Long x,
Long y )
@@ -1441,29 +1460,33 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Conic_To */
- /* */
- /* <Description> */
- /* Inject a new conic arc and adjust the profile list. */
- /* */
- /* <Input> */
- /* cx :: The x-coordinate of the arc's new control point. */
- /* */
- /* cy :: The y-coordinate of the arc's new control point. */
- /* */
- /* x :: The x-coordinate of the arc's end point (its start point is */
- /* stored in `lastX'). */
- /* */
- /* y :: The y-coordinate of the arc's end point (its start point is */
- /* stored in `lastY'). */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow or incorrect */
- /* profile. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Conic_To
+ *
+ * @Description:
+ * Inject a new conic arc and adjust the profile list.
+ *
+ * @Input:
+ * cx ::
+ * The x-coordinate of the arc's new control point.
+ *
+ * cy ::
+ * The y-coordinate of the arc's new control point.
+ *
+ * x ::
+ * The x-coordinate of the arc's end point (its start point is
+ * stored in `lastX').
+ *
+ * y ::
+ * The y-coordinate of the arc's end point (its start point is
+ * stored in `lastY').
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow or incorrect
+ * profile.
+ */
static Bool
Conic_To( RAS_ARGS Long cx,
Long cy,
@@ -1558,33 +1581,39 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Cubic_To */
- /* */
- /* <Description> */
- /* Inject a new cubic arc and adjust the profile list. */
- /* */
- /* <Input> */
- /* cx1 :: The x-coordinate of the arc's first new control point. */
- /* */
- /* cy1 :: The y-coordinate of the arc's first new control point. */
- /* */
- /* cx2 :: The x-coordinate of the arc's second new control point. */
- /* */
- /* cy2 :: The y-coordinate of the arc's second new control point. */
- /* */
- /* x :: The x-coordinate of the arc's end point (its start point is */
- /* stored in `lastX'). */
- /* */
- /* y :: The y-coordinate of the arc's end point (its start point is */
- /* stored in `lastY'). */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on render pool overflow or incorrect */
- /* profile. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Cubic_To
+ *
+ * @Description:
+ * Inject a new cubic arc and adjust the profile list.
+ *
+ * @Input:
+ * cx1 ::
+ * The x-coordinate of the arc's first new control point.
+ *
+ * cy1 ::
+ * The y-coordinate of the arc's first new control point.
+ *
+ * cx2 ::
+ * The x-coordinate of the arc's second new control point.
+ *
+ * cy2 ::
+ * The y-coordinate of the arc's second new control point.
+ *
+ * x ::
+ * The x-coordinate of the arc's end point (its start point is
+ * stored in `lastX').
+ *
+ * y ::
+ * The y-coordinate of the arc's end point (its start point is
+ * stored in `lastY').
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on render pool overflow or incorrect
+ * profile.
+ */
static Bool
Cubic_To( RAS_ARGS Long cx1,
Long cy1,
@@ -1705,27 +1734,30 @@
} while ( 0 )
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Decompose_Curve */
- /* */
- /* <Description> */
- /* Scan the outline arrays in order to emit individual segments and */
- /* Beziers by calling Line_To() and Bezier_To(). It handles all */
- /* weird cases, like when the first point is off the curve, or when */
- /* there are simply no `on' points in the contour! */
- /* */
- /* <Input> */
- /* first :: The index of the first point in the contour. */
- /* */
- /* last :: The index of the last point in the contour. */
- /* */
- /* flipped :: If set, flip the direction of the curve. */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE on error. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Decompose_Curve
+ *
+ * @Description:
+ * Scan the outline arrays in order to emit individual segments and
+ * Beziers by calling Line_To() and Bezier_To(). It handles all
+ * weird cases, like when the first point is off the curve, or when
+ * there are simply no `on' points in the contour!
+ *
+ * @Input:
+ * first ::
+ * The index of the first point in the contour.
+ *
+ * last ::
+ * The index of the last point in the contour.
+ *
+ * flipped ::
+ * If set, flip the direction of the curve.
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE on error.
+ */
static Bool
Decompose_Curve( RAS_ARGS UShort first,
UShort last,
@@ -1934,22 +1966,23 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Convert_Glyph */
- /* */
- /* <Description> */
- /* Convert a glyph into a series of segments and arcs and make a */
- /* profiles list with them. */
- /* */
- /* <Input> */
- /* flipped :: If set, flip the direction of curve. */
- /* */
- /* <Return> */
- /* SUCCESS on success, FAILURE if any error was encountered during */
- /* rendering. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Convert_Glyph
+ *
+ * @Description:
+ * Convert a glyph into a series of segments and arcs and make a
+ * profiles list with them.
+ *
+ * @Input:
+ * flipped ::
+ * If set, flip the direction of curve.
+ *
+ * @Return:
+ * SUCCESS on success, FAILURE if any error was encountered during
+ * rendering.
+ */
static Bool
Convert_Glyph( RAS_ARGS Int flipped )
{
@@ -2028,12 +2061,12 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* Init_Linked */
- /* */
- /* Initializes an empty linked list. */
- /* */
+ /**************************************************************************
+ *
+ * Init_Linked
+ *
+ * Initializes an empty linked list.
+ */
static void
Init_Linked( TProfileList* l )
{
@@ -2041,12 +2074,12 @@
}
- /*************************************************************************/
- /* */
- /* InsNew */
- /* */
- /* Inserts a new profile in a linked list. */
- /* */
+ /**************************************************************************
+ *
+ * InsNew
+ *
+ * Inserts a new profile in a linked list.
+ */
static void
InsNew( PProfileList list,
PProfile profile )
@@ -2072,12 +2105,12 @@
}
- /*************************************************************************/
- /* */
- /* DelOld */
- /* */
- /* Removes an old profile from a linked list. */
- /* */
+ /**************************************************************************
+ *
+ * DelOld
+ *
+ * Removes an old profile from a linked list.
+ */
static void
DelOld( PProfileList list,
PProfile profile )
@@ -2105,14 +2138,14 @@
}
- /*************************************************************************/
- /* */
- /* Sort */
- /* */
- /* Sorts a trace list. In 95%, the list is already sorted. We need */
- /* an algorithm which is fast in this case. Bubble sort is enough */
- /* and simple. */
- /* */
+ /**************************************************************************
+ *
+ * Sort
+ *
+ * Sorts a trace list. In 95%, the list is already sorted. We need
+ * an algorithm which is fast in this case. Bubble sort is enough
+ * and simple.
+ */
static void
Sort( PProfileList list )
{
@@ -2163,14 +2196,14 @@
}
- /*************************************************************************/
- /* */
- /* Vertical Sweep Procedure Set */
- /* */
- /* These four routines are used during the vertical black/white sweep */
- /* phase by the generic Draw_Sweep() function. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Vertical Sweep Procedure Set
+ *
+ * These four routines are used during the vertical black/white sweep
+ * phase by the generic Draw_Sweep() function.
+ *
+ */
static void
Vertical_Sweep_Init( RAS_ARGS Short* min,
@@ -2183,8 +2216,6 @@
ras.traceIncr = (Short)-pitch;
ras.traceOfs = -*min * pitch;
- if ( pitch > 0 )
- ras.traceOfs += (Long)( ras.target.rows - 1 ) * pitch;
}
@@ -2215,13 +2246,18 @@
/* Drop-out control */
- e1 = TRUNC( CEILING( x1 ) );
+ e1 = CEILING( x1 );
+ e2 = FLOOR( x2 );
+ /* take care of the special case where both the left */
+ /* and right contour lie exactly on pixel centers */
if ( dropOutControl != 2 &&
- x2 - x1 - ras.precision <= ras.precision_jitter )
+ x2 - x1 - ras.precision <= ras.precision_jitter &&
+ e1 != x1 && e2 != x2 )
e2 = e1;
- else
- e2 = TRUNC( FLOOR( x2 ) );
+
+ e1 = TRUNC( e1 );
+ e2 = TRUNC( e2 );
if ( e2 >= 0 && e1 < ras.bWidth )
{
@@ -2242,7 +2278,7 @@
f1 = (Byte) ( 0xFF >> ( e1 & 7 ) );
f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) );
- target = ras.bTarget + ras.traceOfs + c1;
+ target = ras.bOrigin + ras.traceOfs + c1;
c2 -= c1;
if ( c2 > 0 )
@@ -2252,12 +2288,9 @@
/* memset() is slower than the following code on many platforms. */
/* This is due to the fact that, in the vast majority of cases, */
/* the span length in bytes is relatively small. */
- c2--;
- while ( c2 > 0 )
- {
+ while ( --c2 > 0 )
*(++target) = 0xFF;
- c2--;
- }
+
target[1] |= f2;
}
else
@@ -2400,7 +2433,7 @@
f1 = (Short)( e1 & 7 );
if ( e1 >= 0 && e1 < ras.bWidth &&
- ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) )
+ ras.bOrigin[ras.traceOfs + c1] & ( 0x80 >> f1 ) )
goto Exit;
}
else
@@ -2416,7 +2449,7 @@
c1 = (Short)( e1 >> 3 );
f1 = (Short)( e1 & 7 );
- ras.bTarget[ras.traceOfs + c1] |= (char)( 0x80 >> f1 );
+ ras.bOrigin[ras.traceOfs + c1] |= (char)( 0x80 >> f1 );
}
Exit:
@@ -2431,14 +2464,14 @@
}
- /***********************************************************************/
- /* */
- /* Horizontal Sweep Procedure Set */
- /* */
- /* These four routines are used during the horizontal black/white */
- /* sweep phase by the generic Draw_Sweep() function. */
- /* */
- /***********************************************************************/
+ /************************************************************************
+ *
+ * Horizontal Sweep Procedure Set
+ *
+ * These four routines are used during the horizontal black/white
+ * sweep phase by the generic Draw_Sweep() function.
+ *
+ */
static void
Horizontal_Sweep_Init( RAS_ARGS Short* min,
@@ -2483,19 +2516,14 @@
{
Byte f1;
PByte bits;
- PByte p;
FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
- bits = ras.bTarget + ( y >> 3 );
+ bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
f1 = (Byte)( 0x80 >> ( y & 7 ) );
- p = bits - e1 * ras.target.pitch;
- if ( ras.target.pitch > 0 )
- p += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
-
- p[0] |= f1;
+ bits[0] |= f1;
}
}
@@ -2597,13 +2625,9 @@
e1 = TRUNC( e1 );
- bits = ras.bTarget + ( y >> 3 );
+ bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
f1 = (Byte)( 0x80 >> ( y & 7 ) );
- bits -= e1 * ras.target.pitch;
- if ( ras.target.pitch > 0 )
- bits += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
-
if ( e1 >= 0 &&
(ULong)e1 < ras.target.rows &&
*bits & f1 )
@@ -2619,12 +2643,8 @@
{
FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
- bits = ras.bTarget + ( y >> 3 );
+ bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
f1 = (Byte)( 0x80 >> ( y & 7 ) );
- bits -= e1 * ras.target.pitch;
-
- if ( ras.target.pitch > 0 )
- bits += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
bits[0] |= f1;
}
@@ -2642,11 +2662,11 @@
}
- /*************************************************************************/
- /* */
- /* Generic Sweep Drawing routine */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Generic Sweep Drawing routine
+ *
+ */
static Bool
Draw_Sweep( RAS_ARG )
@@ -2888,20 +2908,109 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Render_Single_Pass */
- /* */
- /* <Description> */
- /* Perform one sweep with sub-banding. */
- /* */
- /* <Input> */
- /* flipped :: If set, flip the direction of the outline. */
- /* */
- /* <Return> */
- /* Renderer error code. */
- /* */
+#ifdef STANDALONE_
+
+ /**************************************************************************
+ *
+ * The following functions should only compile in stand-alone mode,
+ * i.e., when building this component without the rest of FreeType.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * @Function:
+ * FT_Outline_Get_CBox
+ *
+ * @Description:
+ * Return an outline's `control box'. The control box encloses all
+ * the outline's points, including Bézier 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 Bézier outside arcs).
+ *
+ * Computing the control box is very fast, while getting the bounding
+ * box can take much more time as it needs to walk over all segments
+ * and arcs in the outline. To get the latter, you can use the
+ * `ftbbox' component, which is dedicated to this single task.
+ *
+ * @Input:
+ * outline ::
+ * A pointer to the source outline descriptor.
+ *
+ * @Output:
+ * acbox ::
+ * The outline's control box.
+ *
+ * @Note:
+ * See @FT_Glyph_Get_CBox for a discussion of tricky fonts.
+ */
+
+ static void
+ FT_Outline_Get_CBox( const FT_Outline* outline,
+ FT_BBox *acbox )
+ {
+ Long xMin, yMin, xMax, yMax;
+
+
+ if ( outline && acbox )
+ {
+ if ( outline->n_points == 0 )
+ {
+ xMin = 0;
+ yMin = 0;
+ xMax = 0;
+ yMax = 0;
+ }
+ else
+ {
+ FT_Vector* vec = outline->points;
+ FT_Vector* limit = vec + outline->n_points;
+
+
+ xMin = xMax = vec->x;
+ yMin = yMax = vec->y;
+ vec++;
+
+ for ( ; vec < limit; vec++ )
+ {
+ Long x, y;
+
+
+ x = vec->x;
+ if ( x < xMin ) xMin = x;
+ if ( x > xMax ) xMax = x;
+
+ y = vec->y;
+ if ( y < yMin ) yMin = y;
+ if ( y > yMax ) yMax = y;
+ }
+ }
+ acbox->xMin = xMin;
+ acbox->xMax = xMax;
+ acbox->yMin = yMin;
+ acbox->yMax = yMax;
+ }
+ }
+
+#endif /* STANDALONE_ */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * Render_Single_Pass
+ *
+ * @Description:
+ * Perform one sweep with sub-banding.
+ *
+ * @Input:
+ * flipped ::
+ * If set, flip the direction of the outline.
+ *
+ * @Return:
+ * Renderer error code.
+ */
static int
Render_Single_Pass( RAS_ARGS Bool flipped )
{
@@ -2963,17 +3072,17 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Render_Glyph */
- /* */
- /* <Description> */
- /* Render a glyph in a bitmap. Sub-banding if needed. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Render_Glyph
+ *
+ * @Description:
+ * Render a glyph in a bitmap. Sub-banding if needed.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
Render_Glyph( RAS_ARG )
{
@@ -2982,7 +3091,6 @@
Set_High_Precision( RAS_VARS ras.outline.flags &
FT_OUTLINE_HIGH_PRECISION );
- ras.scale_shift = ras.precision_shift;
if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS )
ras.dropOutControl = 2;
@@ -3013,7 +3121,10 @@
ras.band_stack[0].y_max = (Short)( ras.target.rows - 1 );
ras.bWidth = (UShort)ras.target.width;
- ras.bTarget = (Byte*)ras.target.buffer;
+ ras.bOrigin = (Byte*)ras.target.buffer;
+
+ if ( ras.target.pitch > 0 )
+ ras.bOrigin += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
if ( ( error = Render_Single_Pass( RAS_VARS 0 ) ) != 0 )
return error;
@@ -3185,20 +3296,6 @@
if ( !target_map->buffer )
return FT_THROW( Invalid );
- /* reject too large outline coordinates */
- {
- FT_Vector* vec = outline->points;
- FT_Vector* limit = vec + outline->n_points;
-
-
- for ( ; vec < limit; vec++ )
- {
- if ( vec->x < -0x1000000L || vec->x > 0x1000000L ||
- vec->y < -0x1000000L || vec->y > 0x1000000L )
- return FT_THROW( Invalid );
- }
- }
-
ras.outline = *outline;
ras.target = *target_map;
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.h b/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.h
index 40b5d6d321c..50d34201a1c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.h
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/ftraster.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftraster.h */
-/* */
-/* The FreeType glyph rasterizer (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftraster.h
+ *
+ * The FreeType glyph rasterizer (specification).
+ *
+ * Copyright (C) 1996-2019 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 FTRASTER_H_
@@ -28,11 +28,11 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* Uncomment the following line if you are using ftraster.c as a */
- /* standalone module, fully independent of FreeType. */
- /* */
+ /**************************************************************************
+ *
+ * Uncomment the following line if you are using ftraster.c as a
+ * standalone module, fully independent of FreeType.
+ */
/* #define STANDALONE_ */
FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster;
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.c b/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.c
index a7ce9731d77..62c727182a4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.c
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftrend1.c */
-/* */
-/* The FreeType glyph rasterizer interface (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftrend1.c
+ *
+ * The FreeType glyph rasterizer interface (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -22,7 +22,6 @@
#include FT_OUTLINE_H
#include "ftrend1.h"
#include "ftraster.h"
-#include "rastpic.h"
#include "rasterrs.h"
@@ -128,7 +127,11 @@
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
- ft_glyphslot_preset_bitmap( slot, mode, origin );
+ if ( ft_glyphslot_preset_bitmap( slot, mode, origin ) )
+ {
+ error = FT_THROW( Raster_Overflow );
+ goto Exit;
+ }
/* allocate new one */
if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
@@ -197,7 +200,7 @@
(FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_raster1_set_mode, /* set_mode */
- (FT_Raster_Funcs*)&FT_STANDARD_RASTER_GET /* raster_class */
+ (FT_Raster_Funcs*)&ft_standard_raster /* raster_class */
)
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.h b/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.h
index 2abdf2d703b..82ecac686c1 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.h
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/ftrend1.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftrend1.h */
-/* */
-/* The FreeType glyph rasterizer interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftrend1.h
+ *
+ * The FreeType glyph rasterizer interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 FTREND1_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/module.mk b/Build/source/libs/freetype2/freetype-src/src/raster/module.mk
index b115f416b2a..0a6d4b09d9d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/raster/raster.c b/Build/source/libs/freetype2/freetype-src/src/raster/raster.c
index 76edd21e1e0..e3ac9e566a3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/raster.c
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/raster.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* raster.c */
-/* */
-/* FreeType monochrome rasterer module component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * raster.c
+ *
+ * FreeType monochrome rasterer module component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -21,7 +21,6 @@
#include "ftraster.c"
#include "ftrend1.c"
-#include "rastpic.c"
/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/rasterrs.h b/Build/source/libs/freetype2/freetype-src/src/raster/rasterrs.h
index 22a3e153406..72664073657 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/rasterrs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/rasterrs.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* rasterrs.h */
-/* */
-/* monochrome renderer error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the monochrome renderer error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * rasterrs.h
+ *
+ * monochrome renderer error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the monochrome renderer error enumeration
+ * constants.
+ *
+ */
#ifndef RASTERRS_H_
#define RASTERRS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/rastpic.c b/Build/source/libs/freetype2/freetype-src/src/raster/rastpic.c
deleted file mode 100644
index 1dc8981b8a6..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/raster/rastpic.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/***************************************************************************/
-/* */
-/* rastpic.c */
-/* */
-/* The FreeType position independent code services for raster module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "rastpic.h"
-#include "rasterrs.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from ftraster.c */
- void
- FT_Init_Class_ft_standard_raster( FT_Raster_Funcs* funcs );
-
-
- void
- ft_raster1_renderer_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->raster )
- {
- RasterPIC* container = (RasterPIC*)pic_container->raster;
-
-
- if ( --container->ref_count )
- return;
- FT_FREE( container );
- pic_container->raster = NULL;
- }
- }
-
-
- FT_Error
- ft_raster1_renderer_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- RasterPIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* XXX: since this function also served the no longer available */
- /* raster5 renderer it uses reference counting, which could */
- /* be removed now */
- if ( pic_container->raster )
- {
- ((RasterPIC*)pic_container->raster)->ref_count++;
- return error;
- }
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->raster = container;
-
- container->ref_count = 1;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- FT_Init_Class_ft_standard_raster( &container->ft_standard_raster );
-
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/rastpic.h b/Build/source/libs/freetype2/freetype-src/src/raster/rastpic.h
deleted file mode 100644
index 6d0877c4239..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/raster/rastpic.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************/
-/* */
-/* rastpic.h */
-/* */
-/* The FreeType position independent code services for raster module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 RASTPIC_H_
-#define RASTPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-FT_BEGIN_HEADER
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_STANDARD_RASTER_GET ft_standard_raster
-
-#else /* FT_CONFIG_OPTION_PIC */
-
- typedef struct RasterPIC_
- {
- int ref_count;
- FT_Raster_Funcs ft_standard_raster;
-
- } RasterPIC;
-
-
-#define GET_PIC( lib ) \
- ( (RasterPIC*)( (lib)->pic_container.raster ) )
-#define FT_STANDARD_RASTER_GET ( GET_PIC( library )->ft_standard_raster )
-
-
- /* see rastpic.c for the implementation */
- void
- ft_raster1_renderer_class_pic_free( FT_Library library );
-
- FT_Error
- ft_raster1_renderer_class_pic_init( FT_Library library );
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-FT_END_HEADER
-
-#endif /* RASTPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/raster/rules.mk b/Build/source/libs/freetype2/freetype-src/src/raster/rules.mk
index 9aef1f0bab6..7664671e809 100644
--- a/Build/source/libs/freetype2/freetype-src/src/raster/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/raster/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -28,8 +28,7 @@ RASTER_COMPILE := $(CC) $(ANSIFLAGS) \
# raster driver sources (i.e., C files)
#
RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
- $(RASTER_DIR)/ftrend1.c \
- $(RASTER_DIR)/rastpic.c
+ $(RASTER_DIR)/ftrend1.c
# raster driver headers
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/Jamfile b/Build/source/libs/freetype2/freetype-src/src/sfnt/Jamfile
index 57977fc966b..f646b3526e2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/sfnt Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -22,6 +22,8 @@ SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ;
sfobjs
ttbdf
ttcmap
+ ttcolr
+ ttcpal
ttkern
ttload
ttmtx
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/module.mk b/Build/source/libs/freetype2/freetype-src/src/sfnt/module.mk
index 51ca67e7845..8c3b44fec7f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c
index 16020266afd..ca85d9751f0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* pngshim.c */
-/* */
-/* PNG Bitmap glyph support. */
-/* */
-/* Copyright 2013-2018 by */
-/* Google, Inc. */
-/* Written by Stuart Gill and Behdad Esfahbod. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pngshim.c
+ *
+ * PNG Bitmap glyph support.
+ *
+ * Copyright (C) 2013-2019 by
+ * Google, Inc.
+ * Written by Stuart Gill and Behdad Esfahbod.
+ *
+ * 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 <ft2build.h>
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.h
index 194238c3a20..06c6f6b20e7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/pngshim.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* pngshim.h */
-/* */
-/* PNG Bitmap glyph support. */
-/* */
-/* Copyright 2013-2018 by */
-/* Google, Inc. */
-/* Written by Stuart Gill and Behdad Esfahbod. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * pngshim.h
+ *
+ * PNG Bitmap glyph support.
+ *
+ * Copyright (C) 2013-2019 by
+ * Google, Inc.
+ * Written by Stuart Gill and Behdad Esfahbod.
+ *
+ * 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 PNGSHIM_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/rules.mk b/Build/source/libs/freetype2/freetype-src/src/sfnt/rules.mk
index 83acc66a8f6..ff9e7c61176 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -28,17 +28,18 @@ SFNT_COMPILE := $(CC) $(ANSIFLAGS) \
# SFNT driver sources (i.e., C files)
#
-SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \
- $(SFNT_DIR)/ttmtx.c \
+SFNT_DRV_SRC := $(SFNT_DIR)/pngshim.c \
+ $(SFNT_DIR)/sfdriver.c \
+ $(SFNT_DIR)/sfobjs.c \
+ $(SFNT_DIR)/ttbdf.c \
$(SFNT_DIR)/ttcmap.c \
- $(SFNT_DIR)/ttsbit.c \
- $(SFNT_DIR)/ttpost.c \
+ $(SFNT_DIR)/ttcolr.c \
+ $(SFNT_DIR)/ttcpal.c \
$(SFNT_DIR)/ttkern.c \
- $(SFNT_DIR)/ttbdf.c \
- $(SFNT_DIR)/sfobjs.c \
- $(SFNT_DIR)/sfdriver.c \
- $(SFNT_DIR)/sfntpic.c \
- $(SFNT_DIR)/pngshim.c
+ $(SFNT_DIR)/ttload.c \
+ $(SFNT_DIR)/ttmtx.c \
+ $(SFNT_DIR)/ttpost.c \
+ $(SFNT_DIR)/ttsbit.c
# SFNT driver headers
#
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.c
index 303e1ca9f1a..c467ff4d370 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* sfdriver.c */
-/* */
-/* High-level SFNT driver interface (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * sfdriver.c
+ *
+ * High-level SFNT driver interface (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -25,7 +25,6 @@
#include "sfdriver.h"
#include "ttload.h"
#include "sfobjs.h"
-#include "sfntpic.h"
#include "sferrors.h"
@@ -33,6 +32,11 @@
#include "ttsbit.h"
#endif
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+#include "ttcolr.h"
+#include "ttcpal.h"
+#endif
+
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.h"
#endif
@@ -57,18 +61,18 @@
#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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_sfdriver
+#define FT_COMPONENT sfdriver
/*
- * SFNT TABLE SERVICE
+ * SFNT TABLE SERVICE
*
*/
@@ -155,7 +159,7 @@
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*
- * GLYPH DICT SERVICE
+ * GLYPH DICT SERVICE
*
*/
@@ -222,7 +226,7 @@
/*
- * POSTSCRIPT NAME SERVICE
+ * POSTSCRIPT NAME SERVICE
*
*/
@@ -460,14 +464,12 @@
typedef int (*char_type_func)( int c );
- /* handling of PID/EID 3/0 and 3/1 is the same */
+ /* Handling of PID/EID 3/0 and 3/1 is the same. */
#define IS_WIN( n ) ( (n)->platformID == 3 && \
- ( (n)->encodingID == 1 || (n)->encodingID == 0 ) && \
- (n)->languageID == 0x409 )
+ ( (n)->encodingID == 1 || (n)->encodingID == 0 ) )
#define IS_APPLE( n ) ( (n)->platformID == 1 && \
- (n)->encodingID == 0 && \
- (n)->languageID == 0 )
+ (n)->encodingID == 0 )
static char*
get_win_string( FT_Memory memory,
@@ -491,42 +493,40 @@
if ( FT_STREAM_SEEK( entry->stringOffset ) ||
FT_FRAME_ENTER( entry->stringLength ) )
- {
- FT_FREE( result );
- entry->stringLength = 0;
- entry->stringOffset = 0;
- FT_FREE( entry->string );
-
- return NULL;
- }
+ goto get_win_string_error;
r = (FT_String*)result;
p = (FT_Char*)stream->cursor;
for ( len = entry->stringLength / 2; len > 0; len--, p += 2 )
{
- if ( p[0] == 0 )
+ if ( p[0] == 0 && char_type( p[1] ) )
+ *r++ = p[1];
+ else
{
- if ( char_type( p[1] ) )
- *r++ = p[1];
- else
- {
- if ( report_invalid_characters )
- {
- FT_TRACE0(( "get_win_string:"
- " Character `%c' (0x%X) invalid in PS name string\n",
- p[1], p[1] ));
- /* it's not the job of FreeType to correct PS names... */
- *r++ = p[1];
- }
- }
+ if ( report_invalid_characters )
+ FT_TRACE0(( "get_win_string:"
+ " Character 0x%X invalid in PS name string\n",
+ ((unsigned)p[0])*256 + (unsigned)p[1] ));
+ break;
}
}
- *r = '\0';
+ if ( !len )
+ *r = '\0';
FT_FRAME_EXIT();
- return result;
+ if ( !len )
+ return result;
+
+ get_win_string_error:
+ FT_FREE( result );
+
+ entry->stringLength = 0;
+ entry->stringOffset = 0;
+ FT_FREE( entry->string );
+
+ return NULL;
}
@@ -552,14 +552,7 @@
if ( FT_STREAM_SEEK( entry->stringOffset ) ||
FT_FRAME_ENTER( entry->stringLength ) )
- {
- FT_FREE( result );
- entry->stringOffset = 0;
- entry->stringLength = 0;
- FT_FREE( entry->string );
-
- return NULL;
- }
+ goto get_apple_string_error;
r = (FT_String*)result;
p = (FT_Char*)stream->cursor;
@@ -571,20 +564,28 @@
else
{
if ( report_invalid_characters )
- {
FT_TRACE0(( "get_apple_string:"
" Character `%c' (0x%X) invalid in PS name string\n",
*p, *p ));
- /* it's not the job of FreeType to correct PS names... */
- *r++ = *p;
- }
+ break;
}
}
- *r = '\0';
+ if ( !len )
+ *r = '\0';
FT_FRAME_EXIT();
- return result;
+ if ( !len )
+ return result;
+
+ get_apple_string_error:
+ FT_FREE( result );
+
+ entry->stringOffset = 0;
+ entry->stringLength = 0;
+ FT_FREE( entry->string );
+
+ return NULL;
}
@@ -607,10 +608,10 @@
if ( name->nameID == id && name->stringLength > 0 )
{
- if ( IS_WIN( name ) )
+ if ( IS_WIN( name ) && ( name->languageID == 0x409 || *win == -1 ) )
*win = n;
- if ( IS_APPLE( name ) )
+ if ( IS_APPLE( name ) && ( name->languageID == 0 || *apple == -1 ) )
*apple = n;
}
}
@@ -643,9 +644,9 @@
/*
- * Find the shortest decimal representation of a 16.16 fixed point
- * number. The function fills `buf' with the result, returning a pointer
- * to the position after the representation's last byte.
+ * Find the shortest decimal representation of a 16.16 fixed point
+ * number. The function fills `buf' with the result, returning a pointer
+ * to the position after the representation's last byte.
*/
static char*
@@ -673,7 +674,7 @@
if ( fixed < 0 )
{
*p++ = '-';
- fixed = -fixed;
+ fixed = NEG_INT( fixed );
}
int_part = ( fixed >> 16 ) & 0xFFFF;
@@ -828,13 +829,20 @@
face->name_table.names + win,
sfnt_is_alphanumeric,
0 );
- else
+ if ( !result && apple != -1 )
result = get_apple_string( face->root.memory,
face->name_table.stream,
face->name_table.names + apple,
sfnt_is_alphanumeric,
0 );
+ if ( !result )
+ {
+ FT_TRACE0(( "sfnt_get_var_ps_name:"
+ " No valid PS name prefix for font instances found\n" ));
+ return NULL;
+ }
+
len = ft_strlen( result );
/* sanitize if necessary; we reserve space for 36 bytes (a 128bit */
@@ -1052,7 +1060,7 @@
face->name_table.names + win,
sfnt_is_postscript,
1 );
- else
+ if ( !result && apple != -1 )
result = get_apple_string( face->root.memory,
face->name_table.stream,
face->name_table.names + apple,
@@ -1073,7 +1081,7 @@
/*
- * TT CMAP INFO
+ * TT CMAP INFO
*/
FT_DEFINE_SERVICE_TTCMAPSREC(
tt_service_get_cmap_info,
@@ -1132,41 +1140,41 @@
/*
- * SERVICE LIST
+ * SERVICE LIST
*/
#if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC5(
sfnt_services,
- FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_GLYPH_DICT, &SFNT_SERVICE_GLYPH_DICT_GET,
- FT_SERVICE_ID_BDF, &SFNT_SERVICE_BDF_GET,
- FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
+ FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
+ FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict,
+ FT_SERVICE_ID_BDF, &sfnt_service_bdf,
+ FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
- FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_GLYPH_DICT, &SFNT_SERVICE_GLYPH_DICT_GET,
- FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
+ FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
+ FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict,
+ FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#elif defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
- FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_BDF, &SFNT_SERVICE_BDF_GET,
- FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
+ FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
+ FT_SERVICE_ID_BDF, &sfnt_service_bdf,
+ FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#else
FT_DEFINE_SERVICEDESCREC3(
sfnt_services,
- FT_SERVICE_ID_SFNT_TABLE, &SFNT_SERVICE_SFNT_TABLE_GET,
- FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
- FT_SERVICE_ID_TT_CMAP, &TT_SERVICE_CMAP_INFO_GET )
+ FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
+ FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#endif
@@ -1174,21 +1182,9 @@
sfnt_get_interface( FT_Module module,
const char* module_interface )
{
- /* SFNT_SERVICES_GET dereferences `library' in PIC mode */
-#ifdef FT_CONFIG_OPTION_PIC
- FT_Library library;
-
-
- if ( !module )
- return NULL;
- library = module->library;
- if ( !library )
- return NULL;
-#else
FT_UNUSED( module );
-#endif
- return ft_service_list_lookup( SFNT_SERVICES_GET, module_interface );
+ return ft_service_list_lookup( sfnt_services, module_interface );
}
@@ -1198,6 +1194,12 @@
#define PUT_EMBEDDED_BITMAPS( a ) NULL
#endif
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+#define PUT_COLOR_LAYERS( a ) a
+#else
+#define PUT_COLOR_LAYERS( a ) NULL
+#endif
+
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#define PUT_PS_NAMES( a ) a
#else
@@ -1256,9 +1258,24 @@
/* TT_Free_Table_Func free_eblc */
PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ),
- /* TT_Set_SBit_Strike_Func set_sbit_strike */
+ /* TT_Set_SBit_Strike_Func set_sbit_strike */
PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
- /* TT_Load_Strike_Metrics_Func load_strike_metrics */
+ /* TT_Load_Strike_Metrics_Func load_strike_metrics */
+
+ PUT_COLOR_LAYERS( tt_face_load_cpal ),
+ /* TT_Load_Table_Func load_cpal */
+ PUT_COLOR_LAYERS( tt_face_load_colr ),
+ /* TT_Load_Table_Func load_colr */
+ PUT_COLOR_LAYERS( tt_face_free_cpal ),
+ /* TT_Free_Table_Func free_cpal */
+ PUT_COLOR_LAYERS( tt_face_free_colr ),
+ /* TT_Free_Table_Func free_colr */
+ PUT_COLOR_LAYERS( tt_face_palette_set ),
+ /* TT_Set_Palette_Func set_palette */
+ PUT_COLOR_LAYERS( tt_face_get_colr_layer ),
+ /* TT_Get_Colr_Layer_Func get_colr_layer */
+ PUT_COLOR_LAYERS( tt_face_colr_blend_layer ),
+ /* TT_Blend_Colr_Func colr_blend */
tt_face_get_metrics, /* TT_Get_Metrics_Func get_metrics */
@@ -1277,7 +1294,7 @@
0x10000L, /* driver version 1.0 */
0x20000L, /* driver requires FreeType 2.0 or higher */
- (const void*)&SFNT_INTERFACE_GET, /* module specific interface */
+ (const void*)&sfnt_interface, /* module specific interface */
(FT_Module_Constructor)NULL, /* module_init */
(FT_Module_Destructor) NULL, /* module_done */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.h
index 81c22d28870..8c174634b37 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfdriver.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* sfdriver.h */
-/* */
-/* High-level SFNT driver interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * sfdriver.h
+ *
+ * High-level SFNT driver interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 SFDRIVER_H_
@@ -26,10 +26,8 @@
FT_BEGIN_HEADER
-
FT_DECLARE_MODULE( sfnt_module_class )
-
FT_END_HEADER
#endif /* SFDRIVER_H_ */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sferrors.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/sferrors.h
index 74003d4b38c..43e148d2954 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sferrors.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sferrors.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* sferrors.h */
-/* */
-/* SFNT error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the SFNT error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * sferrors.h
+ *
+ * SFNT error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the SFNT error enumeration constants.
+ *
+ */
#ifndef SFERRORS_H_
#define SFERRORS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfnt.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfnt.c
index 8b9a6b345df..5a503f30c54 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfnt.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfnt.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* sfnt.c */
-/* */
-/* Single object library component. */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * sfnt.c
+ *
+ * Single object library component.
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -21,10 +21,12 @@
#include "pngshim.c"
#include "sfdriver.c"
-#include "sfntpic.c"
#include "sfobjs.c"
#include "ttbdf.c"
#include "ttcmap.c"
+#include "ttcolr.c"
+#include "ttcpal.c"
+
#include "ttkern.c"
#include "ttload.c"
#include "ttmtx.c"
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.c
deleted file mode 100644
index db2d816ce68..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/***************************************************************************/
-/* */
-/* sfntpic.c */
-/* */
-/* The FreeType position independent code services for sfnt module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "sfntpic.h"
-#include "sferrors.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from sfdriver.c */
- FT_Error
- FT_Create_Class_sfnt_services( FT_Library library,
- FT_ServiceDescRec** output_class );
- void
- FT_Destroy_Class_sfnt_services( FT_Library library,
- FT_ServiceDescRec* clazz );
- void
- FT_Init_Class_sfnt_service_bdf( FT_Service_BDFRec* clazz );
- void
- FT_Init_Class_sfnt_interface( FT_Library library,
- SFNT_Interface* clazz );
- void
- FT_Init_Class_sfnt_service_glyph_dict(
- FT_Library library,
- FT_Service_GlyphDictRec* clazz );
- void
- FT_Init_Class_sfnt_service_ps_name(
- FT_Library library,
- FT_Service_PsFontNameRec* clazz );
- void
- FT_Init_Class_tt_service_get_cmap_info(
- FT_Library library,
- FT_Service_TTCMapsRec* clazz );
- void
- FT_Init_Class_sfnt_service_sfnt_table(
- FT_Service_SFNT_TableRec* clazz );
-
-
- /* forward declaration of PIC init functions from ttcmap.c */
- FT_Error
- FT_Create_Class_tt_cmap_classes( FT_Library library,
- TT_CMap_Class** output_class );
- void
- FT_Destroy_Class_tt_cmap_classes( FT_Library library,
- TT_CMap_Class* clazz );
-
-
- void
- sfnt_module_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->sfnt )
- {
- sfntModulePIC* container = (sfntModulePIC*)pic_container->sfnt;
-
-
- if ( container->sfnt_services )
- FT_Destroy_Class_sfnt_services( library,
- container->sfnt_services );
- container->sfnt_services = NULL;
-
- if ( container->tt_cmap_classes )
- FT_Destroy_Class_tt_cmap_classes( library,
- container->tt_cmap_classes );
- container->tt_cmap_classes = NULL;
-
- FT_FREE( container );
- pic_container->sfnt = NULL;
- }
- }
-
-
- FT_Error
- sfnt_module_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- sfntModulePIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->sfnt = container;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- error = FT_Create_Class_sfnt_services( library,
- &container->sfnt_services );
- if ( error )
- goto Exit;
-
- error = FT_Create_Class_tt_cmap_classes( library,
- &container->tt_cmap_classes );
- if ( error )
- goto Exit;
-
- FT_Init_Class_sfnt_service_glyph_dict(
- library, &container->sfnt_service_glyph_dict );
- FT_Init_Class_sfnt_service_ps_name(
- library, &container->sfnt_service_ps_name );
- FT_Init_Class_tt_service_get_cmap_info(
- library, &container->tt_service_get_cmap_info );
- FT_Init_Class_sfnt_service_sfnt_table(
- &container->sfnt_service_sfnt_table );
-#ifdef TT_CONFIG_OPTION_BDF
- FT_Init_Class_sfnt_service_bdf( &container->sfnt_service_bdf );
-#endif
- FT_Init_Class_sfnt_interface( library, &container->sfnt_interface );
-
- Exit:
- if ( error )
- sfnt_module_class_pic_free( library );
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.h
deleted file mode 100644
index 8f43122d81b..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfntpic.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/***************************************************************************/
-/* */
-/* sfntpic.h */
-/* */
-/* The FreeType position independent code services for sfnt module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 SFNTPIC_H_
-#define SFNTPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define SFNT_SERVICES_GET sfnt_services
-#define SFNT_SERVICE_GLYPH_DICT_GET sfnt_service_glyph_dict
-#define SFNT_SERVICE_PS_NAME_GET sfnt_service_ps_name
-#define TT_SERVICE_CMAP_INFO_GET tt_service_get_cmap_info
-#define TT_CMAP_CLASSES_GET tt_cmap_classes
-#define SFNT_SERVICE_SFNT_TABLE_GET sfnt_service_sfnt_table
-#define SFNT_SERVICE_BDF_GET sfnt_service_bdf
-#define SFNT_INTERFACE_GET sfnt_interface
-
-#else /* FT_CONFIG_OPTION_PIC */
-
- /* some include files required for members of sfntModulePIC */
-#include FT_SERVICE_GLYPH_DICT_H
-#include FT_SERVICE_POSTSCRIPT_NAME_H
-#include FT_SERVICE_SFNT_H
-#include FT_SERVICE_TT_CMAP_H
-
-#ifdef TT_CONFIG_OPTION_BDF
-#include "ttbdf.h"
-#include FT_SERVICE_BDF_H
-#endif
-
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_SFNT_H
-#include "ttcmap.h"
-
-
-FT_BEGIN_HEADER
-
- typedef struct sfntModulePIC_
- {
- FT_ServiceDescRec* sfnt_services;
- FT_Service_GlyphDictRec sfnt_service_glyph_dict;
- FT_Service_PsFontNameRec sfnt_service_ps_name;
- FT_Service_TTCMapsRec tt_service_get_cmap_info;
- TT_CMap_Class* tt_cmap_classes;
- FT_Service_SFNT_TableRec sfnt_service_sfnt_table;
-#ifdef TT_CONFIG_OPTION_BDF
- FT_Service_BDFRec sfnt_service_bdf;
-#endif
- SFNT_Interface sfnt_interface;
-
- } sfntModulePIC;
-
-
-#define GET_PIC( lib ) \
- ( (sfntModulePIC*)( (lib)->pic_container.sfnt ) )
-
-#define SFNT_SERVICES_GET \
- ( GET_PIC( library )->sfnt_services )
-#define SFNT_SERVICE_GLYPH_DICT_GET \
- ( GET_PIC( library )->sfnt_service_glyph_dict )
-#define SFNT_SERVICE_PS_NAME_GET \
- ( GET_PIC( library )->sfnt_service_ps_name )
-#define TT_SERVICE_CMAP_INFO_GET \
- ( GET_PIC( library )->tt_service_get_cmap_info )
-#define TT_CMAP_CLASSES_GET \
- ( GET_PIC( library )->tt_cmap_classes )
-#define SFNT_SERVICE_SFNT_TABLE_GET \
- ( GET_PIC( library )->sfnt_service_sfnt_table )
-#define SFNT_SERVICE_BDF_GET \
- ( GET_PIC( library )->sfnt_service_bdf )
-#define SFNT_INTERFACE_GET \
- ( GET_PIC( library )->sfnt_interface )
-
-
- /* see sfntpic.c for the implementation */
- void
- sfnt_module_class_pic_free( FT_Library library );
-
- FT_Error
- sfnt_module_class_pic_init( FT_Library library );
-
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* SFNTPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c
index 6ba8509f569..0b43d251b87 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* sfobjs.c */
-/* */
-/* SFNT object management (base). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * sfobjs.c
+ *
+ * SFNT object management (base).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -41,14 +41,14 @@
#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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_sfobjs
+#define FT_COMPONENT sfobjs
@@ -918,7 +918,9 @@
/* Stream may have changed in sfnt_open_font. */
stream = face->root.stream;
- FT_TRACE2(( "sfnt_init_face: %08p, %d\n", face, face_instance_index ));
+ FT_TRACE2(( "sfnt_init_face: %08p (index %d)\n",
+ face,
+ face_instance_index ));
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
@@ -1001,15 +1003,15 @@
face->variation_support |= TT_FACE_FLAG_VAR_FVAR;
/*
- * 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.
+ * 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
- * later on. Here, we have to adjust `num_instances' accordingly.
+ * For consistency, we always want the default instance in our list
+ * of named instances. If it is missing, we try to synthesize it
+ * later on. Here, we have to adjust `num_instances' accordingly.
*/
if ( ( face->variation_support & TT_FACE_FLAG_VAR_FVAR ) &&
@@ -1341,6 +1343,13 @@
if ( sfnt->load_eblc )
LOAD_( eblc );
+ /* colored glyph support */
+ if ( sfnt->load_cpal )
+ {
+ LOAD_( cpal );
+ LOAD_( colr );
+ }
+
/* consider the pclt, kerning, and gasp tables as optional */
LOAD_( pclt );
LOAD_( gasp );
@@ -1389,12 +1398,13 @@
FT_Long flags = root->face_flags;
- /*********************************************************************/
- /* */
- /* Compute face flags. */
- /* */
+ /**********************************************************************
+ *
+ * Compute face flags.
+ */
if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_CBLC ||
- face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX )
+ face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX ||
+ face->colr )
flags |= FT_FACE_FLAG_COLOR; /* color glyphs */
if ( has_outline == TRUE )
@@ -1438,10 +1448,10 @@
root->face_flags = flags;
- /*********************************************************************/
- /* */
- /* Compute style flags. */
- /* */
+ /**********************************************************************
+ *
+ * Compute style flags.
+ */
flags = 0;
if ( has_outline == TRUE && face->os2.version != 0xFFFFU )
@@ -1471,14 +1481,14 @@
root->style_flags |= flags;
- /*********************************************************************/
- /* */
- /* Polish the charmaps. */
- /* */
- /* Try to set the charmap encoding according to the platform & */
- /* encoding ID of each charmap. Emulate Unicode charmap if one */
- /* is missing. */
- /* */
+ /**********************************************************************
+ *
+ * Polish the charmaps.
+ *
+ * Try to set the charmap encoding according to the platform &
+ * encoding ID of each charmap. Emulate Unicode charmap if one
+ * is missing.
+ */
tt_face_build_cmaps( face ); /* ignore errors */
@@ -1521,7 +1531,8 @@
error = FT_CMap_New( (FT_CMap_Class)&tt_cmap_unicode_class_rec,
NULL, &cmaprec, NULL );
if ( error &&
- FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
+ FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) &&
+ FT_ERR_NEQ( error, Unimplemented_Feature ) )
goto Exit;
error = FT_Err_Ok;
@@ -1533,9 +1544,9 @@
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/*
- * Now allocate the root array of FT_Bitmap_Size records and
- * populate them. Unfortunately, it isn't possible to indicate bit
- * depths in the FT_Bitmap_Size record. This is a design error.
+ * Now allocate the root array of FT_Bitmap_Size records and
+ * populate them. Unfortunately, it isn't possible to indicate bit
+ * depths in the FT_Bitmap_Size record. This is a design error.
*/
{
FT_UInt count;
@@ -1615,10 +1626,10 @@
root->face_flags |= FT_FACE_FLAG_SCALABLE;
- /*********************************************************************/
- /* */
- /* Set up metrics. */
- /* */
+ /**********************************************************************
+ *
+ * Set up metrics.
+ */
if ( FT_IS_SCALABLE( root ) )
{
/* XXX What about if outline header is missing */
@@ -1630,59 +1641,73 @@
root->units_per_EM = face->header.Units_Per_EM;
- /* XXX: Computing the ascender/descender/height is very different */
- /* from what the specification tells you. Apparently, we */
- /* must be careful because */
- /* */
- /* - not all fonts have an OS/2 table; in this case, we take */
- /* the values in the horizontal header. However, these */
- /* values very often are not reliable. */
- /* */
- /* - otherwise, the correct typographic values are in the */
- /* sTypoAscender, sTypoDescender & sTypoLineGap fields. */
- /* */
- /* However, certain fonts have these fields set to 0. */
- /* Rather, they have usWinAscent & usWinDescent correctly */
- /* set (but with different values). */
- /* */
- /* As an example, Arial Narrow is implemented through four */
- /* files ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */
- /* */
- /* Strangely, all fonts have the same values in their */
- /* sTypoXXX fields, except ARIALNB which sets them to 0. */
- /* */
- /* On the other hand, they all have different */
- /* usWinAscent/Descent values -- as a conclusion, the OS/2 */
- /* table cannot be used to compute the text height reliably! */
- /* */
-
- /* The ascender and descender are taken from the `hhea' table. */
- /* If zero, they are taken from the `OS/2' table. */
-
- root->ascender = face->horizontal.Ascender;
- root->descender = face->horizontal.Descender;
-
- root->height = root->ascender - root->descender +
- face->horizontal.Line_Gap;
-
- if ( !( root->ascender || root->descender ) )
+ /*
+ * Computing the ascender/descender/height is tricky.
+ *
+ * The OpenType specification v1.8.3 says:
+ *
+ * [OS/2's] sTypoAscender, sTypoDescender and sTypoLineGap fields
+ * are intended to allow applications to lay out documents in a
+ * typographically-correct and portable fashion.
+ *
+ * This is somewhat at odds with the decades of backwards
+ * compatibility, operating systems and applications doing whatever
+ * they want, not to mention broken fonts.
+ *
+ * Not all fonts have an OS/2 table; in this case, we take the values
+ * in the horizontal header, although there is nothing stopping the
+ * values from being unreliable. Even with a OS/2 table, certain fonts
+ * set the sTypoAscender, sTypoDescender and sTypoLineGap fields to 0
+ * and instead correctly set usWinAscent and usWinDescent.
+ *
+ * As an example, Arial Narrow is shipped as four files ARIALN.TTF,
+ * ARIALNI.TTF, ARIALNB.TTF and ARIALNBI.TTF. Strangely, all fonts have
+ * the same values in their sTypo* fields, except ARIALNB.ttf which
+ * sets them to 0. All of them have different usWinAscent/Descent
+ * values. The OS/2 table therefore cannot be trusted for computing the
+ * text height reliably.
+ *
+ * As a compromise, do the following:
+ *
+ * 1. If the OS/2 table exists and the fsSelection bit 7 is set
+ * (USE_TYPO_METRICS), trust the font and use the sTypo* metrics.
+ * 2. Otherwise, use the `hhea' table's metrics.
+ * 3. If they are zero and the OS/2 table exists,
+ * 1. use the OS/2 table's sTypo* metrics if they are non-zero.
+ * 2. Otherwise, use the OS/2 table's usWin* metrics.
+ */
+
+ if ( face->os2.version != 0xFFFFU && face->os2.fsSelection & 128 )
{
- if ( face->os2.version != 0xFFFFU )
- {
- if ( face->os2.sTypoAscender || face->os2.sTypoDescender )
- {
- root->ascender = face->os2.sTypoAscender;
- root->descender = face->os2.sTypoDescender;
+ root->ascender = face->os2.sTypoAscender;
+ root->descender = face->os2.sTypoDescender;
+ root->height = root->ascender - root->descender +
+ face->os2.sTypoLineGap;
+ }
+ else
+ {
+ root->ascender = face->horizontal.Ascender;
+ root->descender = face->horizontal.Descender;
+ root->height = root->ascender - root->descender +
+ face->horizontal.Line_Gap;
- root->height = root->ascender - root->descender +
- face->os2.sTypoLineGap;
- }
- else
+ if ( !( root->ascender || root->descender ) )
+ {
+ if ( face->os2.version != 0xFFFFU )
{
- root->ascender = (FT_Short)face->os2.usWinAscent;
- root->descender = -(FT_Short)face->os2.usWinDescent;
-
- root->height = root->ascender - root->descender;
+ if ( face->os2.sTypoAscender || face->os2.sTypoDescender )
+ {
+ root->ascender = face->os2.sTypoAscender;
+ root->descender = face->os2.sTypoDescender;
+ root->height = root->ascender - root->descender +
+ face->os2.sTypoLineGap;
+ }
+ else
+ {
+ root->ascender = (FT_Short)face->os2.usWinAscent;
+ root->descender = -(FT_Short)face->os2.usWinDescent;
+ root->height = root->ascender - root->descender;
+ }
}
}
}
@@ -1737,6 +1762,13 @@
/* destroy the embedded bitmaps table if it is loaded */
if ( sfnt->free_eblc )
sfnt->free_eblc( face );
+
+ /* destroy color table data if it is loaded */
+ if ( sfnt->free_cpal )
+ {
+ sfnt->free_cpal( face );
+ sfnt->free_colr( face );
+ }
}
#ifdef TT_CONFIG_OPTION_BDF
@@ -1792,11 +1824,18 @@
FT_FREE( face->sbit_strike_map );
face->root.num_fixed_sizes = 0;
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_FREE( face->postscript_name );
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_FREE( face->var_postscript_prefix );
#endif
+ /* freeing glyph color palette data */
+ FT_FREE( face->palette_data.palette_name_ids );
+ FT_FREE( face->palette_data.palette_flags );
+ FT_FREE( face->palette_data.palette_entry_name_ids );
+ FT_FREE( face->palette );
+
face->sfnt = NULL;
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.h
index 1b8d1be5b1a..17b0d50105e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* sfobjs.h */
-/* */
-/* SFNT object management (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * sfobjs.h
+ *
+ * SFNT object management (specification).
+ *
+ * Copyright (C) 1996-2019 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 SFOBJS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.c
index 534201f229f..853599fc43c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttbdf.c */
-/* */
-/* TrueType and OpenType embedded BDF properties (body). */
-/* */
-/* Copyright 2005-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttbdf.c
+ *
+ * TrueType and OpenType embedded BDF properties (body).
+ *
+ * Copyright (C) 2005-2019 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 <ft2build.h>
@@ -27,14 +27,14 @@
#ifdef TT_CONFIG_OPTION_BDF
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttbdf
+#define FT_COMPONENT ttbdf
FT_LOCAL_DEF( void )
@@ -45,7 +45,7 @@
if ( bdf->loaded )
{
- FT_Stream stream = FT_FACE(face)->stream;
+ FT_Stream stream = FT_FACE( face )->stream;
if ( bdf->table )
@@ -111,8 +111,8 @@
FT_UInt num_items = FT_PEEK_USHORT( p + 2 );
/*
- * We don't need to check the value sets themselves, since this
- * is done later.
+ * We don't need to check the value sets themselves, since this
+ * is done later.
*/
strike += 10 * num_items;
@@ -142,7 +142,7 @@
BDF_PropertyRec *aprop )
{
TT_BDF bdf = &face->bdf;
- FT_Size size = FT_FACE(face)->size;
+ FT_Size size = FT_FACE( face )->size;
FT_Error error = FT_Err_Ok;
FT_Byte* p;
FT_UInt count;
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.h
index 809a6630011..e4164e61fc7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttbdf.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttbdf.h */
-/* */
-/* TrueType and OpenType embedded BDF properties (specification). */
-/* */
-/* Copyright 2005-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttbdf.h
+ *
+ * TrueType and OpenType embedded BDF properties (specification).
+ *
+ * Copyright (C) 2005-2019 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 TTBDF_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.c
index 996e66485fa..8d9737310c7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttcmap.c */
-/* */
-/* TrueType character mapping table (cmap) support (body). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttcmap.c
+ *
+ * TrueType character mapping table (cmap) support (body).
+ *
+ * Copyright (C) 2002-2019 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 <ft2build.h>
@@ -27,17 +27,16 @@
#include "ttload.h"
#include "ttcmap.h"
#include "ttpost.h"
-#include "sfntpic.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttcmap
+#define FT_COMPONENT ttcmap
#define TT_PEEK_SHORT FT_PEEK_SHORT
@@ -77,19 +76,19 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 0 */
- /* length 2 USHORT table length in bytes */
- /* language 4 USHORT Mac language code */
- /* glyph_ids 6 BYTE[256] array of glyph indices */
- /* 262 */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 0
+ * length 2 USHORT table length in bytes
+ * language 4 USHORT Mac language code
+ * glyph_ids 6 BYTE[256] array of glyph indices
+ * 262
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_0
@@ -238,57 +237,57 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 2 */
- /* length 2 USHORT table length in bytes */
- /* language 4 USHORT Mac language code */
- /* keys 6 USHORT[256] sub-header keys */
- /* subs 518 SUBHEAD[NSUBS] sub-headers array */
- /* glyph_ids 518+NSUB*8 USHORT[] glyph ID array */
- /* */
- /* The `keys' table is used to map charcode high bytes to sub-headers. */
- /* The value of `NSUBS' is the number of sub-headers defined in the */
- /* table and is computed by finding the maximum of the `keys' table. */
- /* */
- /* Note that for any `n', `keys[n]' is a byte offset within the `subs' */
- /* table, i.e., it is the corresponding sub-header index multiplied */
- /* by 8. */
- /* */
- /* Each sub-header has the following format. */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* first 0 USHORT first valid low-byte */
- /* count 2 USHORT number of valid low-bytes */
- /* delta 4 SHORT see below */
- /* offset 6 USHORT see below */
- /* */
- /* A sub-header defines, for each high byte, the range of valid */
- /* low bytes within the charmap. Note that the range defined by `first' */
- /* and `count' must be completely included in the interval [0..255] */
- /* according to the specification. */
- /* */
- /* If a character code is contained within a given sub-header, then */
- /* mapping it to a glyph index is done as follows. */
- /* */
- /* * The value of `offset' is read. This is a _byte_ distance from the */
- /* location of the `offset' field itself into a slice of the */
- /* `glyph_ids' table. Let's call it `slice' (it is a USHORT[], too). */
- /* */
- /* * The value `slice[char.lo - first]' is read. If it is 0, there is */
- /* no glyph for the charcode. Otherwise, the value of `delta' is */
- /* added to it (modulo 65536) to form a new glyph index. */
- /* */
- /* It is up to the validation routine to check that all offsets fall */
- /* within the glyph IDs table (and not within the `subs' table itself or */
- /* outside of the CMap). */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 2
+ * length 2 USHORT table length in bytes
+ * language 4 USHORT Mac language code
+ * keys 6 USHORT[256] sub-header keys
+ * subs 518 SUBHEAD[NSUBS] sub-headers array
+ * glyph_ids 518+NSUB*8 USHORT[] glyph ID array
+ *
+ * The `keys' table is used to map charcode high bytes to sub-headers.
+ * The value of `NSUBS' is the number of sub-headers defined in the
+ * table and is computed by finding the maximum of the `keys' table.
+ *
+ * Note that for any `n', `keys[n]' is a byte offset within the `subs'
+ * table, i.e., it is the corresponding sub-header index multiplied
+ * by 8.
+ *
+ * Each sub-header has the following format.
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * first 0 USHORT first valid low-byte
+ * count 2 USHORT number of valid low-bytes
+ * delta 4 SHORT see below
+ * offset 6 USHORT see below
+ *
+ * A sub-header defines, for each high byte, the range of valid
+ * low bytes within the charmap. Note that the range defined by `first'
+ * and `count' must be completely included in the interval [0..255]
+ * according to the specification.
+ *
+ * If a character code is contained within a given sub-header, then
+ * mapping it to a glyph index is done as follows.
+ *
+ * - The value of `offset' is read. This is a _byte_ distance from the
+ * location of the `offset' field itself into a slice of the
+ * `glyph_ids' table. Let's call it `slice' (it is a USHORT[], too).
+ *
+ * - The value `slice[char.lo - first]' is read. If it is 0, there is
+ * no glyph for the charcode. Otherwise, the value of `delta' is
+ * added to it (modulo 65536) to form a new glyph index.
+ *
+ * It is up to the validation routine to check that all offsets fall
+ * within the glyph IDs table (and not within the `subs' table itself or
+ * outside of the CMap).
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_2
@@ -626,68 +625,68 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 4 */
- /* length 2 USHORT table length */
- /* in bytes */
- /* language 4 USHORT Mac language code */
- /* */
- /* segCountX2 6 USHORT 2*NUM_SEGS */
- /* searchRange 8 USHORT 2*(1 << LOG_SEGS) */
- /* entrySelector 10 USHORT LOG_SEGS */
- /* rangeShift 12 USHORT segCountX2 - */
- /* searchRange */
- /* */
- /* endCount 14 USHORT[NUM_SEGS] end charcode for */
- /* each segment; last */
- /* is 0xFFFF */
- /* */
- /* pad 14+NUM_SEGS*2 USHORT padding */
- /* */
- /* startCount 16+NUM_SEGS*2 USHORT[NUM_SEGS] first charcode for */
- /* each segment */
- /* */
- /* idDelta 16+NUM_SEGS*4 SHORT[NUM_SEGS] delta for each */
- /* segment */
- /* idOffset 16+NUM_SEGS*6 SHORT[NUM_SEGS] range offset for */
- /* each segment; can be */
- /* zero */
- /* */
- /* glyphIds 16+NUM_SEGS*8 USHORT[] array of glyph ID */
- /* ranges */
- /* */
- /* Character codes are modelled by a series of ordered (increasing) */
- /* intervals called segments. Each segment has start and end codes, */
- /* provided by the `startCount' and `endCount' arrays. Segments must */
- /* not overlap, and the last segment should always contain the value */
- /* 0xFFFF for `endCount'. */
- /* */
- /* The fields `searchRange', `entrySelector' and `rangeShift' are better */
- /* ignored (they are traces of over-engineering in the TrueType */
- /* specification). */
- /* */
- /* Each segment also has a signed `delta', as well as an optional offset */
- /* within the `glyphIds' table. */
- /* */
- /* If a segment's idOffset is 0, the glyph index corresponding to any */
- /* charcode within the segment is obtained by adding the value of */
- /* `idDelta' directly to the charcode, modulo 65536. */
- /* */
- /* Otherwise, a glyph index is taken from the glyph IDs sub-array for */
- /* the segment, and the value of `idDelta' is added to it. */
- /* */
- /* */
- /* Finally, note that a lot of fonts contain an invalid last segment, */
- /* where `start' and `end' are correctly set to 0xFFFF but both `delta' */
- /* and `offset' are incorrect (e.g., `opens___.ttf' which comes with */
- /* OpenOffice.org). We need special code to deal with them correctly. */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 4
+ * length 2 USHORT table length
+ * in bytes
+ * language 4 USHORT Mac language code
+ *
+ * segCountX2 6 USHORT 2*NUM_SEGS
+ * searchRange 8 USHORT 2*(1 << LOG_SEGS)
+ * entrySelector 10 USHORT LOG_SEGS
+ * rangeShift 12 USHORT segCountX2 -
+ * searchRange
+ *
+ * endCount 14 USHORT[NUM_SEGS] end charcode for
+ * each segment; last
+ * is 0xFFFF
+ *
+ * pad 14+NUM_SEGS*2 USHORT padding
+ *
+ * startCount 16+NUM_SEGS*2 USHORT[NUM_SEGS] first charcode for
+ * each segment
+ *
+ * idDelta 16+NUM_SEGS*4 SHORT[NUM_SEGS] delta for each
+ * segment
+ * idOffset 16+NUM_SEGS*6 SHORT[NUM_SEGS] range offset for
+ * each segment; can be
+ * zero
+ *
+ * glyphIds 16+NUM_SEGS*8 USHORT[] array of glyph ID
+ * ranges
+ *
+ * Character codes are modelled by a series of ordered (increasing)
+ * intervals called segments. Each segment has start and end codes,
+ * provided by the `startCount' and `endCount' arrays. Segments must
+ * not overlap, and the last segment should always contain the value
+ * 0xFFFF for `endCount'.
+ *
+ * The fields `searchRange', `entrySelector' and `rangeShift' are better
+ * ignored (they are traces of over-engineering in the TrueType
+ * specification).
+ *
+ * Each segment also has a signed `delta', as well as an optional offset
+ * within the `glyphIds' table.
+ *
+ * If a segment's idOffset is 0, the glyph index corresponding to any
+ * charcode within the segment is obtained by adding the value of
+ * `idDelta' directly to the charcode, modulo 65536.
+ *
+ * Otherwise, a glyph index is taken from the glyph IDs sub-array for
+ * the segment, and the value of `idDelta' is added to it.
+ *
+ *
+ * Finally, note that a lot of fonts contain an invalid last segment,
+ * where `start' and `end' are correctly set to 0xFFFF but both `delta'
+ * and `offset' are incorrect (e.g., `opens___.ttf' which comes with
+ * OpenOffice.org). We need special code to deal with them correctly.
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_4
@@ -1573,23 +1572,23 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 6 */
- /* length 2 USHORT table length in bytes */
- /* language 4 USHORT Mac language code */
- /* */
- /* first 6 USHORT first segment code */
- /* count 8 USHORT segment size in chars */
- /* glyphIds 10 USHORT[count] glyph IDs */
- /* */
- /* A very simplified segment mapping. */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 6
+ * length 2 USHORT table length in bytes
+ * language 4 USHORT Mac language code
+ *
+ * first 6 USHORT first segment code
+ * count 8 USHORT segment size in chars
+ * glyphIds 10 USHORT[count] glyph IDs
+ *
+ * A very simplified segment mapping.
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_6
@@ -1768,26 +1767,26 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 8 */
- /* reserved 2 USHORT reserved */
- /* length 4 ULONG length in bytes */
- /* language 8 ULONG Mac language code */
- /* is32 12 BYTE[8192] 32-bitness bitmap */
- /* count 8204 ULONG number of groups */
- /* */
- /* This header is followed by `count' groups of the following format: */
- /* */
- /* start 0 ULONG first charcode */
- /* end 4 ULONG last charcode */
- /* startId 8 ULONG start glyph ID for the group */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 8
+ * reserved 2 USHORT reserved
+ * length 4 ULONG length in bytes
+ * language 8 ULONG Mac language code
+ * is32 12 BYTE[8192] 32-bitness bitmap
+ * count 8204 ULONG number of groups
+ *
+ * This header is followed by `count' groups of the following format:
+ *
+ * start 0 ULONG first charcode
+ * end 4 ULONG last charcode
+ * startId 8 ULONG start glyph ID for the group
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_8
@@ -2037,22 +2036,22 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 10 */
- /* reserved 2 USHORT reserved */
- /* length 4 ULONG length in bytes */
- /* language 8 ULONG Mac language code */
- /* */
- /* start 12 ULONG first char in range */
- /* count 16 ULONG number of chars in range */
- /* glyphIds 20 USHORT[count] glyph indices covered */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 10
+ * reserved 2 USHORT reserved
+ * length 4 ULONG length in bytes
+ * language 8 ULONG Mac language code
+ *
+ * start 12 ULONG first char in range
+ * count 16 ULONG number of chars in range
+ * glyphIds 20 USHORT[count] glyph indices covered
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_10
@@ -2209,26 +2208,26 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 12 */
- /* reserved 2 USHORT reserved */
- /* length 4 ULONG length in bytes */
- /* language 8 ULONG Mac language code */
- /* count 12 ULONG number of groups */
- /* 16 */
- /* */
- /* This header is followed by `count' groups of the following format: */
- /* */
- /* start 0 ULONG first charcode */
- /* end 4 ULONG last charcode */
- /* startId 8 ULONG start glyph ID for the group */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 12
+ * reserved 2 USHORT reserved
+ * length 4 ULONG length in bytes
+ * language 8 ULONG Mac language code
+ * count 12 ULONG number of groups
+ * 16
+ *
+ * This header is followed by `count' groups of the following format:
+ *
+ * start 0 ULONG first charcode
+ * end 4 ULONG last charcode
+ * startId 8 ULONG start glyph ID for the group
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_12
@@ -2565,26 +2564,26 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 13 */
- /* reserved 2 USHORT reserved */
- /* length 4 ULONG length in bytes */
- /* language 8 ULONG Mac language code */
- /* count 12 ULONG number of groups */
- /* 16 */
- /* */
- /* This header is followed by `count' groups of the following format: */
- /* */
- /* start 0 ULONG first charcode */
- /* end 4 ULONG last charcode */
- /* glyphId 8 ULONG glyph ID for the whole group */
- /* */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 13
+ * reserved 2 USHORT reserved
+ * length 4 ULONG length in bytes
+ * language 8 ULONG Mac language code
+ * count 12 ULONG number of groups
+ * 16
+ *
+ * This header is followed by `count' groups of the following format:
+ *
+ * start 0 ULONG first charcode
+ * end 4 ULONG last charcode
+ * glyphId 8 ULONG glyph ID for the whole group
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_13
@@ -2891,58 +2890,59 @@
/*************************************************************************/
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* TABLE OVERVIEW */
- /* -------------- */
- /* */
- /* NAME OFFSET TYPE DESCRIPTION */
- /* */
- /* format 0 USHORT must be 14 */
- /* length 2 ULONG table length in bytes */
- /* numSelector 6 ULONG number of variation sel. records */
- /* */
- /* Followed by numSelector records, each of which looks like */
- /* */
- /* varSelector 0 UINT24 Unicode codepoint of sel. */
- /* defaultOff 3 ULONG offset to a default UVS table */
- /* describing any variants to be found in */
- /* the normal Unicode subtable. */
- /* nonDefOff 7 ULONG offset to a non-default UVS table */
- /* describing any variants not in the */
- /* standard cmap, with GIDs here */
- /* (either offset may be 0 NULL) */
- /* */
- /* Selectors are sorted by code point. */
- /* */
- /* A default Unicode Variation Selector (UVS) subtable is just a list of */
- /* ranges of code points which are to be found in the standard cmap. No */
- /* glyph IDs (GIDs) here. */
- /* */
- /* numRanges 0 ULONG number of ranges following */
- /* */
- /* A range looks like */
- /* */
- /* uniStart 0 UINT24 code point of the first character in */
- /* this range */
- /* additionalCnt 3 UBYTE count of additional characters in this */
- /* range (zero means a range of a single */
- /* character) */
- /* */
- /* Ranges are sorted by `uniStart'. */
- /* */
- /* A non-default Unicode Variation Selector (UVS) subtable is a list of */
- /* mappings from codepoint to GID. */
- /* */
- /* numMappings 0 ULONG number of mappings */
- /* */
- /* A range looks like */
- /* */
- /* uniStart 0 UINT24 code point of the first character in */
- /* this range */
- /* GID 3 USHORT and its GID */
- /* */
- /* Ranges are sorted by `uniStart'. */
+ /**************************************************************************
+ *
+ * TABLE OVERVIEW
+ * --------------
+ *
+ * NAME OFFSET TYPE DESCRIPTION
+ *
+ * format 0 USHORT must be 14
+ * length 2 ULONG table length in bytes
+ * numSelector 6 ULONG number of variation sel. records
+ *
+ * Followed by numSelector records, each of which looks like
+ *
+ * varSelector 0 UINT24 Unicode codepoint of sel.
+ * defaultOff 3 ULONG offset to a default UVS table
+ * describing any variants to be found in
+ * the normal Unicode subtable.
+ * nonDefOff 7 ULONG offset to a non-default UVS table
+ * describing any variants not in the
+ * standard cmap, with GIDs here
+ * (either offset may be 0 NULL)
+ *
+ * Selectors are sorted by code point.
+ *
+ * A default Unicode Variation Selector (UVS) subtable is just a list of
+ * ranges of code points which are to be found in the standard cmap. No
+ * glyph IDs (GIDs) here.
+ *
+ * numRanges 0 ULONG number of ranges following
+ *
+ * A range looks like
+ *
+ * uniStart 0 UINT24 code point of the first character in
+ * this range
+ * additionalCnt 3 UBYTE count of additional characters in this
+ * range (zero means a range of a single
+ * character)
+ *
+ * Ranges are sorted by `uniStart'.
+ *
+ * A non-default Unicode Variation Selector (UVS) subtable is a list of
+ * mappings from codepoint to GID.
+ *
+ * numMappings 0 ULONG number of mappings
+ *
+ * A range looks like
+ *
+ * uniStart 0 UINT24 code point of the first character in
+ * this range
+ * GID 3 USHORT and its GID
+ *
+ * Ranges are sorted by `uniStart'.
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_14
@@ -3681,6 +3681,9 @@
FT_UNUSED( pointer );
+ if ( !psnames->unicodes_init )
+ return FT_THROW( Unimplemented_Feature );
+
return psnames->unicodes_init( memory,
unicodes,
face->root.num_glyphs,
@@ -3749,7 +3752,6 @@
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
-#ifndef FT_CONFIG_OPTION_PIC
static const TT_CMap_Class tt_cmap_classes[] =
{
@@ -3758,61 +3760,6 @@
NULL,
};
-#else /*FT_CONFIG_OPTION_PIC*/
-
- void
- FT_Destroy_Class_tt_cmap_classes( FT_Library library,
- TT_CMap_Class* clazz )
- {
- FT_Memory memory = library->memory;
-
-
- if ( clazz )
- FT_FREE( clazz );
- }
-
-
- FT_Error
- FT_Create_Class_tt_cmap_classes( FT_Library library,
- TT_CMap_Class** output_class )
- {
- TT_CMap_Class* clazz = NULL;
- TT_CMap_ClassRec* recs;
- FT_Error error;
- FT_Memory memory = library->memory;
-
- int i = 0;
-
-
-#define TTCMAPCITEM( a ) i++;
-#include "ttcmapc.h"
-
- /* allocate enough space for both the pointers */
- /* plus terminator and the class instances */
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * ( i + 1 ) +
- sizeof ( TT_CMap_ClassRec ) * i ) )
- return error;
-
- /* the location of the class instances follows the array of pointers */
- recs = (TT_CMap_ClassRec*)( (char*)clazz +
- sizeof ( *clazz ) * ( i + 1 ) );
- i = 0;
-
-#undef TTCMAPCITEM
-#define TTCMAPCITEM( a ) \
- FT_Init_Class_ ## a( &recs[i] ); \
- clazz[i] = &recs[i]; \
- i++;
-#include "ttcmapc.h"
-
- clazz[i] = NULL;
-
- *output_class = clazz;
- return FT_Err_Ok;
- }
-
-#endif /*FT_CONFIG_OPTION_PIC*/
-
/* parse the `cmap' table and build the corresponding TT_CMap objects */
/* in the current face */
@@ -3859,7 +3806,7 @@
{
FT_Byte* volatile cmap = table + offset;
volatile FT_UInt format = TT_PEEK_USHORT( cmap );
- const TT_CMap_Class* volatile pclazz = TT_CMAP_CLASSES_GET;
+ const TT_CMap_Class* volatile pclazz = tt_cmap_classes;
TT_CMap_Class volatile clazz;
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.h
index d264d99d2c9..36801c939ee 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmap.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttcmap.h */
-/* */
-/* TrueType character mapping table (cmap) support (specification). */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttcmap.h
+ *
+ * TrueType character mapping table (cmap) support (specification).
+ *
+ * Copyright (C) 2002-2019 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 TTCMAP_H_
@@ -56,8 +56,6 @@ FT_BEGIN_HEADER
} TT_CMap_ClassRec;
-#ifndef FT_CONFIG_OPTION_PIC
-
#define FT_DEFINE_TT_CMAP( class_, \
size_, \
init_, \
@@ -92,42 +90,6 @@ FT_BEGIN_HEADER
get_cmap_info_ \
};
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_TT_CMAP( class_, \
- size_, \
- init_, \
- done_, \
- char_index_, \
- char_next_, \
- char_var_index_, \
- char_var_default_, \
- variant_list_, \
- charvariant_list_, \
- variantchar_list_, \
- format_, \
- validate_, \
- get_cmap_info_ ) \
- void \
- FT_Init_Class_ ## class_( TT_CMap_ClassRec* clazz ) \
- { \
- clazz->clazz.size = size_; \
- clazz->clazz.init = init_; \
- clazz->clazz.done = done_; \
- clazz->clazz.char_index = char_index_; \
- clazz->clazz.char_next = char_next_; \
- clazz->clazz.char_var_index = char_var_index_; \
- clazz->clazz.char_var_default = char_var_default_; \
- clazz->clazz.variant_list = variant_list_; \
- clazz->clazz.charvariant_list = charvariant_list_; \
- clazz->clazz.variantchar_list = variantchar_list_; \
- clazz->format = format_; \
- clazz->validate = validate_; \
- clazz->get_cmap_info = get_cmap_info_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
typedef struct TT_ValidatorRec_
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmapc.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmapc.h
index 4980e9dd3dc..ace9e69ca8d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmapc.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcmapc.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttcmapc.h */
-/* */
-/* TT CMAP classes definitions (specification only). */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttcmapc.h
+ *
+ * TT CMAP classes definitions (specification only).
+ *
+ * Copyright (C) 2009-2019 by
+ * Oran Agra and Mickey Gabel.
+ *
+ * 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.
+ *
+ */
#ifdef TT_CONFIG_CMAP_FORMAT_0
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.c
new file mode 100644
index 00000000000..6b537d95b85
--- /dev/null
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.c
@@ -0,0 +1,451 @@
+/****************************************************************************
+ *
+ * ttcolr.c
+ *
+ * TrueType and OpenType colored glyph layer support (body).
+ *
+ * Copyright (C) 2018-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * Originally written by Shao Yu Zhang <shaozhang@fb.com>.
+ *
+ * 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.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * `COLR' table specification:
+ *
+ * https://www.microsoft.com/typography/otspec/colr.htm
+ *
+ */
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_TRUETYPE_TAGS_H
+#include FT_COLOR_H
+
+
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+
+#include "ttcolr.h"
+
+
+ /* NOTE: These are the table sizes calculated through the specs. */
+#define BASE_GLYPH_SIZE 6
+#define LAYER_SIZE 4
+#define COLR_HEADER_SIZE 14
+
+
+ typedef struct BaseGlyphRecord_
+ {
+ FT_UShort gid;
+ FT_UShort first_layer_index;
+ FT_UShort num_layers;
+
+ } BaseGlyphRecord;
+
+
+ typedef struct Colr_
+ {
+ FT_UShort version;
+ FT_UShort num_base_glyphs;
+ FT_UShort num_layers;
+
+ FT_Byte* base_glyphs;
+ FT_Byte* layers;
+
+ /* The memory which backs up the `COLR' table. */
+ void* table;
+ FT_ULong table_size;
+
+ } Colr;
+
+
+ /**************************************************************************
+ *
+ * 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 ttcolr
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_load_colr( TT_Face face,
+ FT_Stream stream )
+ {
+ FT_Error error;
+ FT_Memory memory = face->root.memory;
+
+ FT_Byte* table = NULL;
+ FT_Byte* p = NULL;
+
+ Colr* colr = NULL;
+
+ FT_ULong base_glyph_offset, layer_offset;
+ FT_ULong table_size;
+
+
+ /* `COLR' always needs `CPAL' */
+ if ( !face->cpal )
+ return FT_THROW( Invalid_File_Format );
+
+ error = face->goto_table( face, TTAG_COLR, stream, &table_size );
+ if ( error )
+ goto NoColr;
+
+ if ( table_size < COLR_HEADER_SIZE )
+ goto InvalidTable;
+
+ if ( FT_FRAME_EXTRACT( table_size, table ) )
+ goto NoColr;
+
+ p = table;
+
+ if ( FT_NEW( colr ) )
+ goto NoColr;
+
+ colr->version = FT_NEXT_USHORT( p );
+ if ( colr->version != 0 )
+ goto InvalidTable;
+
+ colr->num_base_glyphs = FT_NEXT_USHORT( p );
+ base_glyph_offset = FT_NEXT_ULONG( p );
+
+ if ( base_glyph_offset >= table_size )
+ goto InvalidTable;
+ if ( colr->num_base_glyphs * BASE_GLYPH_SIZE >
+ table_size - base_glyph_offset )
+ goto InvalidTable;
+
+ layer_offset = FT_NEXT_ULONG( p );
+ colr->num_layers = FT_NEXT_USHORT( p );
+
+ if ( layer_offset >= table_size )
+ goto InvalidTable;
+ if ( colr->num_layers * LAYER_SIZE > table_size - layer_offset )
+ goto InvalidTable;
+
+ colr->base_glyphs = (FT_Byte*)( table + base_glyph_offset );
+ colr->layers = (FT_Byte*)( table + layer_offset );
+ colr->table = table;
+ colr->table_size = table_size;
+
+ face->colr = colr;
+
+ return FT_Err_Ok;
+
+ InvalidTable:
+ error = FT_THROW( Invalid_Table );
+
+ NoColr:
+ FT_FRAME_RELEASE( table );
+ FT_FREE( colr );
+
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ tt_face_free_colr( TT_Face face )
+ {
+ FT_Stream stream = face->root.stream;
+ FT_Memory memory = face->root.memory;
+
+ Colr* colr = (Colr*)face->colr;
+
+
+ if ( colr )
+ {
+ FT_FRAME_RELEASE( colr->table );
+ FT_FREE( colr );
+ }
+ }
+
+
+ static FT_Bool
+ find_base_glyph_record( FT_Byte* base_glyph_begin,
+ FT_Int num_base_glyph,
+ FT_UInt glyph_id,
+ BaseGlyphRecord* record )
+ {
+ FT_Int min = 0;
+ FT_Int max = num_base_glyph - 1;
+
+
+ while ( min <= max )
+ {
+ FT_Int mid = min + ( max - min ) / 2;
+ FT_Byte* p = base_glyph_begin + mid * BASE_GLYPH_SIZE;
+
+ FT_UShort gid = FT_NEXT_USHORT( p );
+
+
+ if ( gid < glyph_id )
+ min = mid + 1;
+ else if (gid > glyph_id )
+ max = mid - 1;
+ else
+ {
+ record->gid = gid;
+ record->first_layer_index = FT_NEXT_USHORT( p );
+ record->num_layers = FT_NEXT_USHORT( p );
+
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ tt_face_get_colr_layer( TT_Face face,
+ FT_UInt base_glyph,
+ FT_UInt *aglyph_index,
+ FT_UInt *acolor_index,
+ FT_LayerIterator* iterator )
+ {
+ Colr* colr = (Colr*)face->colr;
+ BaseGlyphRecord glyph_record;
+
+
+ if ( !colr )
+ return 0;
+
+ if ( !iterator->p )
+ {
+ FT_ULong offset;
+
+
+ /* first call to function */
+ iterator->layer = 0;
+
+ if ( !find_base_glyph_record( colr->base_glyphs,
+ colr->num_base_glyphs,
+ base_glyph,
+ &glyph_record ) )
+ return 0;
+
+ if ( glyph_record.num_layers )
+ iterator->num_layers = glyph_record.num_layers;
+ else
+ return 0;
+
+ offset = LAYER_SIZE * glyph_record.first_layer_index;
+ if ( offset + LAYER_SIZE * glyph_record.num_layers > colr->table_size )
+ return 0;
+
+ iterator->p = colr->layers + offset;
+ }
+
+ if ( iterator->layer >= iterator->num_layers )
+ return 0;
+
+ *aglyph_index = FT_NEXT_USHORT( iterator->p );
+ *acolor_index = FT_NEXT_USHORT( iterator->p );
+
+ if ( *aglyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) ||
+ ( *acolor_index != 0xFFFF &&
+ *acolor_index >= face->palette_data.num_palette_entries ) )
+ return 0;
+
+ iterator->layer++;
+
+ return 1;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_colr_blend_layer( TT_Face face,
+ FT_UInt color_index,
+ FT_GlyphSlot dstSlot,
+ FT_GlyphSlot srcSlot )
+ {
+ FT_Error error;
+
+ FT_UInt x, y;
+ FT_Byte b, g, r, alpha;
+
+ FT_ULong size;
+ FT_Byte* src;
+ FT_Byte* dst;
+
+
+ if ( !dstSlot->bitmap.buffer )
+ {
+ /* Initialize destination of color bitmap */
+ /* with the size of first component. */
+ dstSlot->bitmap_left = srcSlot->bitmap_left;
+ dstSlot->bitmap_top = srcSlot->bitmap_top;
+
+ dstSlot->bitmap.width = srcSlot->bitmap.width;
+ dstSlot->bitmap.rows = srcSlot->bitmap.rows;
+ dstSlot->bitmap.pixel_mode = FT_PIXEL_MODE_BGRA;
+ dstSlot->bitmap.pitch = (int)dstSlot->bitmap.width * 4;
+ dstSlot->bitmap.num_grays = 256;
+
+ size = dstSlot->bitmap.rows * (unsigned int)dstSlot->bitmap.pitch;
+
+ error = ft_glyphslot_alloc_bitmap( dstSlot, size );
+ if ( error )
+ return error;
+
+ FT_MEM_ZERO( dstSlot->bitmap.buffer, size );
+ }
+ else
+ {
+ /* Resize destination if needed such that new component fits. */
+ FT_Int x_min, x_max, y_min, y_max;
+
+
+ x_min = FT_MIN( dstSlot->bitmap_left, srcSlot->bitmap_left );
+ x_max = FT_MAX( dstSlot->bitmap_left + (FT_Int)dstSlot->bitmap.width,
+ srcSlot->bitmap_left + (FT_Int)srcSlot->bitmap.width );
+
+ y_min = FT_MIN( dstSlot->bitmap_top - (FT_Int)dstSlot->bitmap.rows,
+ srcSlot->bitmap_top - (FT_Int)srcSlot->bitmap.rows );
+ y_max = FT_MAX( dstSlot->bitmap_top, srcSlot->bitmap_top );
+
+ if ( x_min != dstSlot->bitmap_left ||
+ x_max != dstSlot->bitmap_left + (FT_Int)dstSlot->bitmap.width ||
+ y_min != dstSlot->bitmap_top - (FT_Int)dstSlot->bitmap.rows ||
+ y_max != dstSlot->bitmap_top )
+ {
+ FT_Memory memory = face->root.memory;
+
+ FT_UInt width = (FT_UInt)( x_max - x_min );
+ FT_UInt rows = (FT_UInt)( y_max - y_min );
+ FT_UInt pitch = width * 4;
+
+ FT_Byte* buf = NULL;
+ FT_Byte* p;
+ FT_Byte* q;
+
+
+ size = rows * pitch;
+ if ( FT_ALLOC( buf, size ) )
+ return error;
+
+ p = dstSlot->bitmap.buffer;
+ q = buf +
+ (int)pitch * ( y_max - dstSlot->bitmap_top ) +
+ 4 * ( dstSlot->bitmap_left - x_min );
+
+ for ( y = 0; y < dstSlot->bitmap.rows; y++ )
+ {
+ FT_MEM_COPY( q, p, dstSlot->bitmap.width * 4 );
+
+ p += dstSlot->bitmap.pitch;
+ q += pitch;
+ }
+
+ ft_glyphslot_set_bitmap( dstSlot, buf );
+
+ dstSlot->bitmap_top = y_max;
+ dstSlot->bitmap_left = x_min;
+
+ dstSlot->bitmap.width = width;
+ dstSlot->bitmap.rows = rows;
+ dstSlot->bitmap.pitch = (int)pitch;
+
+ dstSlot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+ dstSlot->format = FT_GLYPH_FORMAT_BITMAP;
+ }
+ }
+
+ if ( color_index == 0xFFFF )
+ {
+ if ( face->have_foreground_color )
+ {
+ b = face->foreground_color.blue;
+ g = face->foreground_color.green;
+ r = face->foreground_color.red;
+ alpha = face->foreground_color.alpha;
+ }
+ else
+ {
+ if ( face->palette_data.palette_flags &&
+ ( face->palette_data.palette_flags[face->palette_index] &
+ FT_PALETTE_FOR_DARK_BACKGROUND ) )
+ {
+ /* white opaque */
+ b = 0xFF;
+ g = 0xFF;
+ r = 0xFF;
+ alpha = 0xFF;
+ }
+ else
+ {
+ /* black opaque */
+ b = 0x00;
+ g = 0x00;
+ r = 0x00;
+ alpha = 0xFF;
+ }
+ }
+ }
+ else
+ {
+ b = face->palette[color_index].blue;
+ g = face->palette[color_index].green;
+ r = face->palette[color_index].red;
+ alpha = face->palette[color_index].alpha;
+ }
+
+ /* XXX Convert if srcSlot.bitmap is not grey? */
+ src = srcSlot->bitmap.buffer;
+ dst = dstSlot->bitmap.buffer +
+ dstSlot->bitmap.pitch * ( dstSlot->bitmap_top - srcSlot->bitmap_top ) +
+ 4 * ( srcSlot->bitmap_left - dstSlot->bitmap_left );
+
+ for ( y = 0; y < srcSlot->bitmap.rows; y++ )
+ {
+ for ( x = 0; x < srcSlot->bitmap.width; x++ )
+ {
+ int aa = src[x];
+ int fa = alpha * aa / 255;
+
+ int fb = b * fa / 255;
+ int fg = g * fa / 255;
+ int fr = r * fa / 255;
+
+ int ba2 = 255 - fa;
+
+ int bb = dst[4 * x + 0];
+ int bg = dst[4 * x + 1];
+ int br = dst[4 * x + 2];
+ int ba = dst[4 * x + 3];
+
+
+ dst[4 * x + 0] = (FT_Byte)( bb * ba2 / 255 + fb );
+ dst[4 * x + 1] = (FT_Byte)( bg * ba2 / 255 + fg );
+ dst[4 * x + 2] = (FT_Byte)( br * ba2 / 255 + fr );
+ dst[4 * x + 3] = (FT_Byte)( ba * ba2 / 255 + fa );
+ }
+
+ src += srcSlot->bitmap.pitch;
+ dst += dstSlot->bitmap.pitch;
+ }
+
+ return FT_Err_Ok;
+ }
+
+#else /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_colr_dummy;
+
+#endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+/* EOF */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.h
new file mode 100644
index 00000000000..817489a855a
--- /dev/null
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcolr.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+ *
+ * ttcolr.h
+ *
+ * TrueType and OpenType colored glyph layer support (specification).
+ *
+ * Copyright (C) 2018-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * Originally written by Shao Yu Zhang <shaozhang@fb.com>.
+ *
+ * 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 __TTCOLR_H__
+#define __TTCOLR_H__
+
+
+#include <ft2build.h>
+#include "ttload.h"
+
+
+FT_BEGIN_HEADER
+
+
+ FT_LOCAL( FT_Error )
+ tt_face_load_colr( TT_Face face,
+ FT_Stream stream );
+
+ FT_LOCAL( void )
+ tt_face_free_colr( TT_Face face );
+
+ FT_LOCAL( FT_Bool )
+ tt_face_get_colr_layer( TT_Face face,
+ FT_UInt base_glyph,
+ FT_UInt *aglyph_index,
+ FT_UInt *acolor_index,
+ FT_LayerIterator* iterator );
+
+ FT_LOCAL( FT_Error )
+ tt_face_colr_blend_layer( TT_Face face,
+ FT_UInt color_index,
+ FT_GlyphSlot dstSlot,
+ FT_GlyphSlot srcSlot );
+
+
+FT_END_HEADER
+
+
+#endif /* __TTCOLR_H__ */
+
+/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.c
new file mode 100644
index 00000000000..3482169a891
--- /dev/null
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.c
@@ -0,0 +1,311 @@
+/****************************************************************************
+ *
+ * ttcpal.c
+ *
+ * TrueType and OpenType color palette support (body).
+ *
+ * Copyright (C) 2018-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * Originally written by Shao Yu Zhang <shaozhang@fb.com>.
+ *
+ * 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.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * `CPAL' table specification:
+ *
+ * https://www.microsoft.com/typography/otspec/cpal.htm
+ *
+ */
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_TRUETYPE_TAGS_H
+#include FT_COLOR_H
+
+
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+
+#include "ttcpal.h"
+
+
+ /* NOTE: These are the table sizes calculated through the specs. */
+#define CPAL_V0_HEADER_BASE_SIZE 12
+#define COLOR_SIZE 4
+
+
+ /* all data from `CPAL' not covered in FT_Palette_Data */
+ typedef struct Cpal_
+ {
+ FT_UShort version; /* Table version number (0 or 1 supported). */
+ FT_UShort num_colors; /* Total number of color records, */
+ /* combined for all palettes. */
+ FT_Byte* colors; /* RGBA array of colors */
+ FT_Byte* color_indices; /* Index of each palette's first color record */
+ /* in the combined color record array. */
+
+ /* The memory which backs up the `CPAL' table. */
+ void* table;
+ FT_ULong table_size;
+
+ } Cpal;
+
+
+ /**************************************************************************
+ *
+ * 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 ttcpal
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_load_cpal( TT_Face face,
+ FT_Stream stream )
+ {
+ FT_Error error;
+ FT_Memory memory = face->root.memory;
+
+ FT_Byte* table = NULL;
+ FT_Byte* p = NULL;
+
+ Cpal* cpal = NULL;
+
+ FT_ULong colors_offset;
+ FT_ULong table_size;
+
+
+ error = face->goto_table( face, TTAG_CPAL, stream, &table_size );
+ if ( error )
+ goto NoCpal;
+
+ if ( table_size < CPAL_V0_HEADER_BASE_SIZE )
+ goto InvalidTable;
+
+ if ( FT_FRAME_EXTRACT( table_size, table ) )
+ goto NoCpal;
+
+ p = table;
+
+ if ( FT_NEW( cpal ) )
+ goto NoCpal;
+
+ cpal->version = FT_NEXT_USHORT( p );
+ if ( cpal->version > 1 )
+ goto InvalidTable;
+
+ face->palette_data.num_palette_entries = FT_NEXT_USHORT( p );
+ face->palette_data.num_palettes = FT_NEXT_USHORT( p );
+
+ cpal->num_colors = FT_NEXT_USHORT( p );
+ colors_offset = FT_NEXT_ULONG( p );
+
+ if ( CPAL_V0_HEADER_BASE_SIZE +
+ face->palette_data.num_palettes * 2U > table_size )
+ goto InvalidTable;
+
+ if ( colors_offset >= table_size )
+ goto InvalidTable;
+ if ( cpal->num_colors * COLOR_SIZE > table_size - colors_offset )
+ goto InvalidTable;
+
+ if ( face->palette_data.num_palette_entries > cpal->num_colors )
+ goto InvalidTable;
+
+ cpal->color_indices = p;
+ cpal->colors = (FT_Byte*)( table + colors_offset );
+
+ if ( cpal->version == 1 )
+ {
+ FT_ULong type_offset, label_offset, entry_label_offset;
+ FT_UShort* array = NULL;
+ FT_UShort* limit;
+ FT_UShort* q;
+
+
+ if ( CPAL_V0_HEADER_BASE_SIZE +
+ face->palette_data.num_palettes * 2U +
+ 3U * 4 > table_size )
+ goto InvalidTable;
+
+ p += face->palette_data.num_palettes * 2;
+
+ type_offset = FT_NEXT_ULONG( p );
+ label_offset = FT_NEXT_ULONG( p );
+ entry_label_offset = FT_NEXT_ULONG( p );
+
+ if ( type_offset )
+ {
+ if ( type_offset >= table_size )
+ goto InvalidTable;
+ if ( face->palette_data.num_palettes * 2 >
+ table_size - type_offset )
+ goto InvalidTable;
+
+ if ( FT_QNEW_ARRAY( array, face->palette_data.num_palettes ) )
+ goto NoCpal;
+
+ p = table + type_offset;
+ q = array;
+ limit = q + face->palette_data.num_palettes;
+
+ while ( q < limit )
+ *q++ = FT_NEXT_USHORT( p );
+
+ face->palette_data.palette_flags = array;
+ }
+
+ if ( label_offset )
+ {
+ if ( label_offset >= table_size )
+ goto InvalidTable;
+ if ( face->palette_data.num_palettes * 2 >
+ table_size - label_offset )
+ goto InvalidTable;
+
+ if ( FT_QNEW_ARRAY( array, face->palette_data.num_palettes ) )
+ goto NoCpal;
+
+ p = table + label_offset;
+ q = array;
+ limit = q + face->palette_data.num_palettes;
+
+ while ( q < limit )
+ *q++ = FT_NEXT_USHORT( p );
+
+ face->palette_data.palette_name_ids = array;
+ }
+
+ if ( entry_label_offset )
+ {
+ if ( entry_label_offset >= table_size )
+ goto InvalidTable;
+ if ( face->palette_data.num_palette_entries * 2 >
+ table_size - entry_label_offset )
+ goto InvalidTable;
+
+ if ( FT_QNEW_ARRAY( array, face->palette_data.num_palette_entries ) )
+ goto NoCpal;
+
+ p = table + entry_label_offset;
+ q = array;
+ limit = q + face->palette_data.num_palette_entries;
+
+ while ( q < limit )
+ *q++ = FT_NEXT_USHORT( p );
+
+ face->palette_data.palette_entry_name_ids = array;
+ }
+ }
+
+ cpal->table = table;
+ cpal->table_size = table_size;
+
+ face->cpal = cpal;
+
+ /* set up default palette */
+ if ( FT_NEW_ARRAY( face->palette,
+ face->palette_data.num_palette_entries ) )
+ goto NoCpal;
+
+ if ( tt_face_palette_set( face, 0 ) )
+ goto InvalidTable;
+
+ return FT_Err_Ok;
+
+ InvalidTable:
+ error = FT_THROW( Invalid_Table );
+
+ NoCpal:
+ FT_FRAME_RELEASE( table );
+ FT_FREE( cpal );
+
+ face->cpal = NULL;
+
+ /* arrays in `face->palette_data' and `face->palette' */
+ /* are freed in `sfnt_done_face' */
+
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ tt_face_free_cpal( TT_Face face )
+ {
+ FT_Stream stream = face->root.stream;
+ FT_Memory memory = face->root.memory;
+
+ Cpal* cpal = (Cpal*)face->cpal;
+
+
+ if ( cpal )
+ {
+ FT_FRAME_RELEASE( cpal->table );
+ FT_FREE( cpal );
+ }
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_palette_set( TT_Face face,
+ FT_UInt palette_index )
+ {
+ Cpal* cpal = (Cpal*)face->cpal;
+
+ FT_Byte* offset;
+ FT_Byte* p;
+
+ FT_Color* q;
+ FT_Color* limit;
+
+ FT_UShort color_index;
+
+
+ if ( !cpal || palette_index >= face->palette_data.num_palettes )
+ return FT_THROW( Invalid_Argument );
+
+ offset = cpal->color_indices + 2 * palette_index;
+ color_index = FT_PEEK_USHORT( offset );
+
+ if ( color_index + face->palette_data.num_palette_entries >
+ cpal->num_colors )
+ return FT_THROW( Invalid_Table );
+
+ p = cpal->colors + COLOR_SIZE * color_index;
+ q = face->palette;
+ limit = q + face->palette_data.num_palette_entries;
+
+ while ( q < limit )
+ {
+ q->blue = FT_NEXT_BYTE( p );
+ q->green = FT_NEXT_BYTE( p );
+ q->red = FT_NEXT_BYTE( p );
+ q->alpha = FT_NEXT_BYTE( p );
+
+ q++;
+ }
+
+ return FT_Err_Ok;
+ }
+
+
+#else /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_cpal_dummy;
+
+#endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+/* EOF */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.h
new file mode 100644
index 00000000000..d1b244f3e34
--- /dev/null
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttcpal.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ *
+ * ttcpal.h
+ *
+ * TrueType and OpenType color palette support (specification).
+ *
+ * Copyright (C) 2018-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * Originally written by Shao Yu Zhang <shaozhang@fb.com>.
+ *
+ * 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 __TTCPAL_H__
+#define __TTCPAL_H__
+
+
+#include <ft2build.h>
+#include "ttload.h"
+
+
+FT_BEGIN_HEADER
+
+
+ FT_LOCAL( FT_Error )
+ tt_face_load_cpal( TT_Face face,
+ FT_Stream stream );
+
+ FT_LOCAL( void )
+ tt_face_free_cpal( TT_Face face );
+
+ FT_LOCAL( FT_Error )
+ tt_face_palette_set( TT_Face face,
+ FT_UInt palette_index );
+
+
+FT_END_HEADER
+
+
+#endif /* __TTCPAL_H__ */
+
+/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.c
index 68f15a20102..8d1b7810904 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ttkern.c */
-/* */
-/* Load the basic TrueType kerning table. This doesn't handle */
-/* kerning data within the GPOS table at the moment. */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttkern.c
+ *
+ * Load the basic TrueType kerning table. This doesn't handle
+ * kerning data within the GPOS table at the moment.
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -26,14 +26,14 @@
#include "sferrors.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttkern
+#define FT_COMPONENT ttkern
#undef TT_KERN_INDEX
@@ -127,8 +127,8 @@
avail |= mask;
/*
- * Now check whether the pairs in this table are ordered.
- * We then can use binary search.
+ * Now check whether the pairs in this table are ordered.
+ * We then can use binary search.
*/
if ( num_pairs > 0 )
{
@@ -283,8 +283,8 @@
break;
/*
- * We don't support format 2 because we haven't seen a single font
- * using it in real life...
+ * We don't support format 2 because we haven't seen a single font
+ * using it in real life...
*/
default:
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.h
index 4e45d0964b4..5f283e5e622 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttkern.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ttkern.h */
-/* */
-/* Load the basic TrueType kerning table. This doesn't handle */
-/* kerning data within the GPOS table at the moment. */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttkern.h
+ *
+ * Load the basic TrueType kerning table. This doesn't handle
+ * kerning data within the GPOS table at the moment.
+ *
+ * Copyright (C) 1996-2019 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 TTKERN_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.c
index a86a546c3dd..5443bf4b696 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.c
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ttload.c */
-/* */
-/* Load the basic TrueType tables, i.e., tables that can be either in */
-/* TTF or OTF fonts (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttload.c
+ *
+ * Load the basic TrueType tables, i.e., tables that can be either in
+ * TTF or OTF fonts (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -26,32 +26,34 @@
#include "sferrors.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttload
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_lookup_table */
- /* */
- /* <Description> */
- /* Looks for a TrueType table by name. */
- /* */
- /* <Input> */
- /* face :: A face object handle. */
- /* */
- /* tag :: The searched tag. */
- /* */
- /* <Return> */
- /* A pointer to the table directory entry. 0 if not found. */
- /* */
+#define FT_COMPONENT ttload
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_lookup_table
+ *
+ * @Description:
+ * Looks for a TrueType table by name.
+ *
+ * @Input:
+ * face ::
+ * A face object handle.
+ *
+ * tag ::
+ * The searched tag.
+ *
+ * @Return:
+ * A pointer to the table directory entry. 0 if not found.
+ */
FT_LOCAL_DEF( TT_Table )
tt_face_lookup_table( TT_Face face,
FT_ULong tag )
@@ -101,27 +103,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_goto_table */
- /* */
- /* <Description> */
- /* Looks for a TrueType table by name, then seek a stream to it. */
- /* */
- /* <Input> */
- /* face :: A face object handle. */
- /* */
- /* tag :: The searched tag. */
- /* */
- /* stream :: The stream to seek when the table is found. */
- /* */
- /* <Output> */
- /* length :: The length of the table if found, undefined otherwise. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_goto_table
+ *
+ * @Description:
+ * Looks for a TrueType table by name, then seek a stream to it.
+ *
+ * @Input:
+ * face ::
+ * A face object handle.
+ *
+ * tag ::
+ * The searched tag.
+ *
+ * stream ::
+ * The stream to seek when the table is found.
+ *
+ * @Output:
+ * length ::
+ * The length of the table if found, undefined otherwise.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_goto_table( TT_Face face,
FT_ULong tag,
@@ -309,28 +315,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_font_dir */
- /* */
- /* <Description> */
- /* Loads the header of a SFNT font file. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Output> */
- /* sfnt :: The SFNT header. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be at the beginning of the font directory. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_font_dir
+ *
+ * @Description:
+ * Loads the header of a SFNT font file.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * @Output:
+ * sfnt ::
+ * The SFNT header.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * @Note:
+ * The stream cursor must be at the beginning of the font directory.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_font_dir( TT_Face face,
FT_Stream stream )
@@ -496,46 +505,51 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_any */
- /* */
- /* <Description> */
- /* Loads any font table into client memory. */
- /* */
- /* <Input> */
- /* face :: The face object to look for. */
- /* */
- /* tag :: The tag of table to load. Use the value 0 if you want */
- /* to access the whole font file, else set this parameter */
- /* to a valid TrueType table tag that you can forge with */
- /* the MAKE_TT_TAG macro. */
- /* */
- /* offset :: The starting offset in the table (or the file if */
- /* tag == 0). */
- /* */
- /* length :: The address of the decision variable: */
- /* */
- /* If length == NULL: */
- /* Loads the whole table. Returns an error if */
- /* `offset' == 0! */
- /* */
- /* If *length == 0: */
- /* Exits immediately; returning the length of the given */
- /* table or of the font file, depending on the value of */
- /* `tag'. */
- /* */
- /* If *length != 0: */
- /* Loads the next `length' bytes of table or font, */
- /* starting at offset `offset' (in table or font too). */
- /* */
- /* <Output> */
- /* buffer :: The address of target buffer. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_any
+ *
+ * @Description:
+ * Loads any font table into client memory.
+ *
+ * @Input:
+ * face ::
+ * The face object to look for.
+ *
+ * tag ::
+ * The tag of table to load. Use the value 0 if you want
+ * to access the whole font file, else set this parameter
+ * to a valid TrueType table tag that you can forge with
+ * the MAKE_TT_TAG macro.
+ *
+ * offset ::
+ * The starting offset in the table (or the file if
+ * tag == 0).
+ *
+ * length ::
+ * The address of the decision variable:
+ *
+ * If length == NULL:
+ * Loads the whole table. Returns an error if
+ * `offset' == 0!
+ *
+ * If *length == 0:
+ * Exits immediately; returning the length of the given
+ * table or of the font file, depending on the value of
+ * `tag'.
+ *
+ * If *length != 0:
+ * Loads the next `length' bytes of table or font,
+ * starting at offset `offset' (in table or font too).
+ *
+ * @Output:
+ * buffer ::
+ * The address of target buffer.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_any( TT_Face face,
FT_ULong tag,
@@ -586,22 +600,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_generic_header */
- /* */
- /* <Description> */
- /* Loads the TrueType table `head' or `bhed'. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_generic_header
+ *
+ * @Description:
+ * Loads the TrueType table `head' or `bhed'.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
tt_face_load_generic_header( TT_Face face,
FT_Stream stream,
@@ -622,10 +638,10 @@
FT_FRAME_LONG ( Magic_Number ),
FT_FRAME_USHORT( Flags ),
FT_FRAME_USHORT( Units_Per_EM ),
- FT_FRAME_LONG ( Created[0] ),
- FT_FRAME_LONG ( Created[1] ),
- FT_FRAME_LONG ( Modified[0] ),
- FT_FRAME_LONG ( Modified[1] ),
+ FT_FRAME_ULONG ( Created[0] ),
+ FT_FRAME_ULONG ( Created[1] ),
+ FT_FRAME_ULONG ( Modified[0] ),
+ FT_FRAME_ULONG ( Modified[1] ),
FT_FRAME_SHORT ( xMin ),
FT_FRAME_SHORT ( yMin ),
FT_FRAME_SHORT ( xMax ),
@@ -676,22 +692,24 @@
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_maxp */
- /* */
- /* <Description> */
- /* Loads the maximum profile into a face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_maxp
+ *
+ * @Description:
+ * Loads the maximum profile into a face object.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_maxp( TT_Face face,
FT_Stream stream )
@@ -784,22 +802,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_name */
- /* */
- /* <Description> */
- /* Loads the name records. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_name
+ *
+ * @Description:
+ * Loads the name records.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_name( TT_Face face,
FT_Stream stream )
@@ -981,17 +1001,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_free_name */
- /* */
- /* <Description> */
- /* Frees the name records. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_free_name
+ *
+ * @Description:
+ * Frees the name records.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ */
FT_LOCAL_DEF( void )
tt_face_free_name( TT_Face face )
{
@@ -1030,23 +1051,25 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_cmap */
- /* */
- /* <Description> */
- /* Loads the cmap directory in a face object. The cmaps themselves */
- /* are loaded on demand in the `ttcmap.c' module. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_cmap
+ *
+ * @Description:
+ * Loads the cmap directory in a face object. The cmaps themselves
+ * are loaded on demand in the `ttcmap.c' module.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_cmap( TT_Face face,
@@ -1068,22 +1091,24 @@
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_os2 */
- /* */
- /* <Description> */
- /* Loads the OS2 table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_os2
+ *
+ * @Description:
+ * Loads the OS2 table.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_os2( TT_Face face,
FT_Stream stream )
@@ -1228,22 +1253,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_postscript */
- /* */
- /* <Description> */
- /* Loads the Postscript table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_postscript
+ *
+ * @Description:
+ * Loads the Postscript table.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_post( TT_Face face,
FT_Stream stream )
@@ -1288,22 +1315,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_pclt */
- /* */
- /* <Description> */
- /* Loads the PCL 5 Table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_pclt
+ *
+ * @Description:
+ * Loads the PCL 5 Table.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_pclt( TT_Face face,
FT_Stream stream )
@@ -1349,22 +1378,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_gasp */
- /* */
- /* <Description> */
- /* Loads the `gasp' table into a face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_gasp
+ *
+ * @Description:
+ * Loads the `gasp' table into a face object.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_gasp( TT_Face face,
FT_Stream stream )
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.h
index f94be8b7bd0..cc18c18694c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttload.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ttload.h */
-/* */
-/* Load the basic TrueType tables, i.e., tables that can be either in */
-/* TTF or OTF fonts (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttload.h
+ *
+ * Load the basic TrueType tables, i.e., tables that can be either in
+ * TTF or OTF fonts (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.c
index 6ddda95b567..7a4d2be2cb8 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttmtx.c */
-/* */
-/* Load the metrics tables common to TTF and OTF fonts (body). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttmtx.c
+ *
+ * Load the metrics tables common to TTF and OTF fonts (body).
+ *
+ * Copyright (C) 2006-2019 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 <ft2build.h>
@@ -38,34 +38,37 @@
/* both the horizontal and vertical headers. */
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttmtx
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_hmtx */
- /* */
- /* <Description> */
- /* Load the `hmtx' or `vmtx' table into a face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* vertical :: A boolean flag. If set, load `vmtx'. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+#define FT_COMPONENT ttmtx
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_hmtx
+ *
+ * @Description:
+ * Load the `hmtx' or `vmtx' table into a face object.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * vertical ::
+ * A boolean flag. If set, load `vmtx'.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_hmtx( TT_Face face,
FT_Stream stream,
@@ -102,24 +105,27 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_hhea */
- /* */
- /* <Description> */
- /* Load the `hhea' or 'vhea' table into a face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* vertical :: A boolean flag. If set, load `vhea'. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_hhea
+ *
+ * @Description:
+ * Load the `hhea' or 'vhea' table into a face object.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * The input stream.
+ *
+ * vertical ::
+ * A boolean flag. If set, load `vhea'.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_hhea( TT_Face face,
FT_Stream stream,
@@ -190,30 +196,35 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_get_metrics */
- /* */
- /* <Description> */
- /* Return the horizontal or vertical metrics in font units for a */
- /* given glyph. The values are the left side bearing (top side */
- /* bearing for vertical metrics) and advance width (advance height */
- /* for vertical metrics). */
- /* */
- /* <Input> */
- /* face :: A pointer to the TrueType face structure. */
- /* */
- /* vertical :: If set to TRUE, get vertical metrics. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* <Output> */
- /* abearing :: The bearing, either left side or top side. */
- /* */
- /* aadvance :: The advance width or advance height, depending on */
- /* the `vertical' flag. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_get_metrics
+ *
+ * @Description:
+ * Return the horizontal or vertical metrics in font units for a
+ * given glyph. The values are the left side bearing (top side
+ * bearing for vertical metrics) and advance width (advance height
+ * for vertical metrics).
+ *
+ * @Input:
+ * face ::
+ * A pointer to the TrueType face structure.
+ *
+ * vertical ::
+ * If set to TRUE, get vertical metrics.
+ *
+ * gindex ::
+ * The glyph index.
+ *
+ * @Output:
+ * abearing ::
+ * The bearing, either left side or top side.
+ *
+ * aadvance ::
+ * The advance width or advance height, depending on
+ * the `vertical' flag.
+ */
FT_LOCAL_DEF( void )
tt_face_get_metrics( TT_Face face,
FT_Bool vertical,
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.h
index ab00acd7952..5b0b60b641c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttmtx.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttmtx.h */
-/* */
-/* Load the metrics tables common to TTF and OTF fonts (specification). */
-/* */
-/* Copyright 2006-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttmtx.h
+ *
+ * Load the metrics tables common to TTF and OTF fonts (specification).
+ *
+ * Copyright (C) 2006-2019 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 TTMTX_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.c
index 6de99ef9778..636a0a004ac 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.c
@@ -1,28 +1,28 @@
-/***************************************************************************/
-/* */
-/* ttpost.c */
-/* */
-/* PostScript name table processing for TrueType and OpenType fonts */
-/* (body). */
-/* */
-/* Copyright 1996-2018 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 post table is not completely loaded by the core engine. This */
- /* file loads the missing PS glyph names and implements an API to access */
- /* them. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ttpost.c
+ *
+ * PostScript name table processing for TrueType and OpenType fonts
+ * (body).
+ *
+ * Copyright (C) 1996-2019 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 post table is not completely loaded by the core engine. This
+ * file loads the missing PS glyph names and implements an API to access
+ * them.
+ *
+ */
#include <ft2build.h>
@@ -38,17 +38,17 @@
#include "sferrors.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttpost
+#define FT_COMPONENT ttpost
- /* If this configuration macro is defined, we rely on the `PSNames' */
+ /* If this configuration macro is defined, we rely on the `psnames' */
/* module to grab the glyph names. */
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
@@ -62,9 +62,9 @@
#else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
- /* Otherwise, we ignore the `PSNames' module, and provide our own */
+ /* Otherwise, we ignore the `psnames' module, and provide our own */
/* table of Mac names. Thus, it is possible to build a version of */
- /* FreeType without the Type 1 driver & PSNames module. */
+ /* FreeType without the Type 1 driver & psnames module. */
#define MAC_NAME( x ) (FT_String*)tt_post_default_names[x]
@@ -459,28 +459,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_get_ps_name */
- /* */
- /* <Description> */
- /* Get the PostScript glyph name of a glyph. */
- /* */
- /* <Input> */
- /* face :: A handle to the parent face. */
- /* */
- /* idx :: The glyph index. */
- /* */
- /* <InOut> */
- /* PSname :: The address of a string pointer. Undefined in case of */
- /* error, otherwise it is a pointer to the glyph name. */
- /* */
- /* You must not modify the returned string! */
- /* */
- /* <Output> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_get_ps_name
+ *
+ * @Description:
+ * Get the PostScript glyph name of a glyph.
+ *
+ * @Input:
+ * face ::
+ * A handle to the parent face.
+ *
+ * idx ::
+ * The glyph index.
+ *
+ * @InOut:
+ * PSname ::
+ * The address of a string pointer. Undefined in case of
+ * error, otherwise it is a pointer to the glyph name.
+ *
+ * You must not modify the returned string!
+ *
+ * @Output:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_get_ps_name( TT_Face face,
FT_UInt idx,
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.h
index 3bec07e4454..812a0fc92db 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttpost.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* ttpost.h */
-/* */
-/* PostScript name table processing for TrueType and OpenType fonts */
-/* (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttpost.h
+ *
+ * PostScript name table processing for TrueType and OpenType fonts
+ * (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTPOST_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.c
index 33b8640bc31..23bd9d7eb00 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.c
@@ -1,22 +1,22 @@
-/***************************************************************************/
-/* */
-/* ttsbit.c */
-/* */
-/* TrueType and OpenType embedded bitmap support (body). */
-/* */
-/* Copyright 2005-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* Copyright 2013 by Google, Inc. */
-/* Google Author(s): Behdad Esfahbod. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttsbit.c
+ *
+ * TrueType and OpenType embedded bitmap support (body).
+ *
+ * Copyright (C) 2005-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * Copyright 2013 by Google, Inc.
+ * Google Author(s): Behdad Esfahbod.
+ *
+ * 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 <ft2build.h>
@@ -36,14 +36,14 @@
#include "pngshim.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttsbit
+#define FT_COMPONENT ttsbit
FT_LOCAL_DEF( FT_Error )
@@ -129,8 +129,8 @@
}
/*
- * Count the number of strikes available in the table. We are a bit
- * paranoid there and don't trust the data.
+ * Count the number of strikes available in the table. We are a bit
+ * paranoid there and don't trust the data.
*/
count = (FT_UInt)num_strikes;
if ( 8 + 48UL * count > table_size )
@@ -182,8 +182,8 @@
" expect bad rendering results\n" ));
/*
- * Count the number of strikes available in the table. We are a bit
- * paranoid there and don't trust the data.
+ * Count the number of strikes available in the table. We are a bit
+ * paranoid there and don't trust the data.
*/
count = (FT_UInt)num_strikes;
if ( 8 + 4UL * count > table_size )
@@ -1014,8 +1014,8 @@
for ( nn = 0; nn < num_components; nn++ )
{
FT_UInt gindex = FT_NEXT_USHORT( p );
- FT_Byte dx = FT_NEXT_BYTE( p );
- FT_Byte dy = FT_NEXT_BYTE( p );
+ FT_Char dx = FT_NEXT_CHAR( p );
+ FT_Char dy = FT_NEXT_CHAR( p );
/* NB: a recursive call */
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.h b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.h
index ce2af3c1628..5ab8ff55689 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.h
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/ttsbit.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttsbit.h */
-/* */
-/* TrueType and OpenType embedded bitmap support (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttsbit.h
+ *
+ * TrueType and OpenType embedded bitmap support (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTSBIT_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/Jamfile b/Build/source/libs/freetype2/freetype-src/src/smooth/Jamfile
index 9957d5e915e..6ca1cede9e4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/smooth Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.c b/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.c
index 803a19e4150..91293ac9463 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.c
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.c
@@ -1,94 +1,94 @@
-/***************************************************************************/
-/* */
-/* ftgrays.c */
-/* */
-/* A new `perfect' anti-aliasing renderer (body). */
-/* */
-/* Copyright 2000-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This file can be compiled without the rest of the FreeType engine, by */
- /* defining the STANDALONE_ macro when compiling it. You also need to */
- /* put the files `ftgrays.h' and `ftimage.h' into the current */
- /* compilation directory. Typically, you could do something like */
- /* */
- /* - copy `src/smooth/ftgrays.c' (this file) to your current directory */
- /* */
- /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */
- /* same directory */
- /* */
- /* - compile `ftgrays' with the STANDALONE_ macro defined, as in */
- /* */
- /* cc -c -DSTANDALONE_ ftgrays.c */
- /* */
- /* The renderer can be initialized with a call to */
- /* `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated */
- /* with a call to `ft_gray_raster.raster_render'. */
- /* */
- /* See the comments and documentation in the file `ftimage.h' for more */
- /* details on how the raster works. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This is a new anti-aliasing scan-converter for FreeType 2. The */
- /* algorithm used here is _very_ different from the one in the standard */
- /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */
- /* coverage of the outline on each pixel cell. */
- /* */
- /* It is based on ideas that I initially found in Raph Levien's */
- /* excellent LibArt graphics library (see http://www.levien.com/libart */
- /* for more information, though the web pages do not tell anything */
- /* about the renderer; you'll have to dive into the source code to */
- /* understand how it works). */
- /* */
- /* Note, however, that this is a _very_ different implementation */
- /* compared to Raph's. Coverage information is stored in a very */
- /* different way, and I don't use sorted vector paths. Also, it doesn't */
- /* use floating point values. */
- /* */
- /* This renderer has the following advantages: */
- /* */
- /* - It doesn't need an intermediate bitmap. Instead, one can supply a */
- /* callback function that will be called by the renderer to draw gray */
- /* spans on any target surface. You can thus do direct composition on */
- /* any kind of bitmap, provided that you give the renderer the right */
- /* callback. */
- /* */
- /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */
- /* each pixel cell. */
- /* */
- /* - It performs a single pass on the outline (the `standard' FT2 */
- /* renderer makes two passes). */
- /* */
- /* - It can easily be modified to render to _any_ number of gray levels */
- /* cheaply. */
- /* */
- /* - For small (< 20) pixel sizes, it is faster than the standard */
- /* renderer. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+/****************************************************************************
+ *
+ * ftgrays.c
+ *
+ * A new `perfect' anti-aliasing renderer (body).
+ *
+ * Copyright (C) 2000-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * This file can be compiled without the rest of the FreeType engine, by
+ * defining the STANDALONE_ macro when compiling it. You also need to
+ * put the files `ftgrays.h' and `ftimage.h' into the current
+ * compilation directory. Typically, you could do something like
+ *
+ * - copy `src/smooth/ftgrays.c' (this file) to your current directory
+ *
+ * - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the
+ * same directory
+ *
+ * - compile `ftgrays' with the STANDALONE_ macro defined, as in
+ *
+ * cc -c -DSTANDALONE_ ftgrays.c
+ *
+ * The renderer can be initialized with a call to
+ * `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated
+ * with a call to `ft_gray_raster.raster_render'.
+ *
+ * See the comments and documentation in the file `ftimage.h' for more
+ * details on how the raster works.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * This is a new anti-aliasing scan-converter for FreeType 2. The
+ * algorithm used here is _very_ different from the one in the standard
+ * `ftraster' module. Actually, `ftgrays' computes the _exact_
+ * coverage of the outline on each pixel cell.
+ *
+ * It is based on ideas that I initially found in Raph Levien's
+ * excellent LibArt graphics library (see https://www.levien.com/libart
+ * for more information, though the web pages do not tell anything
+ * about the renderer; you'll have to dive into the source code to
+ * understand how it works).
+ *
+ * Note, however, that this is a _very_ different implementation
+ * compared to Raph's. Coverage information is stored in a very
+ * different way, and I don't use sorted vector paths. Also, it doesn't
+ * use floating point values.
+ *
+ * This renderer has the following advantages:
+ *
+ * - It doesn't need an intermediate bitmap. Instead, one can supply a
+ * callback function that will be called by the renderer to draw gray
+ * spans on any target surface. You can thus do direct composition on
+ * any kind of bitmap, provided that you give the renderer the right
+ * callback.
+ *
+ * - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on
+ * each pixel cell.
+ *
+ * - It performs a single pass on the outline (the `standard' FT2
+ * renderer makes two passes).
+ *
+ * - It can easily be modified to render to _any_ number of gray levels
+ * cheaply.
+ *
+ * - For small (< 20) pixel sizes, it is faster than the standard
+ * renderer.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * 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 trace_smooth
+#define FT_COMPONENT smooth
#ifdef STANDALONE_
@@ -112,9 +112,9 @@
/*
- * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min'
- * algorithm. We use alpha = 1, beta = 3/8, giving us results with a
- * largest error less than 7% compared to the exact value.
+ * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min'
+ * algorithm. We use alpha = 1, beta = 3/8, giving us results with a
+ * largest error less than 7% compared to the exact value.
*/
#define FT_HYPOT( x, y ) \
( x = FT_ABS( x ), \
@@ -222,10 +222,10 @@ typedef ptrdiff_t FT_PtrDist;
#endif
#define FT_THROW( e ) \
- ( FT_Throw( FT_ERR_CAT( ErrRaster, e ), \
+ ( FT_Throw( FT_ERR_CAT( ErrRaster_, e ), \
__LINE__, \
__FILE__ ) | \
- FT_ERR_CAT( ErrRaster, e ) )
+ FT_ERR_CAT( ErrRaster_, e ) )
#else /* !FT_DEBUG_LEVEL_TRACE */
@@ -279,8 +279,6 @@ typedef ptrdiff_t FT_PtrDist;
#include "ftsmerrs.h"
-#include "ftspic.h"
-
#define Smooth_Err_Invalid_Mode Smooth_Err_Cannot_Render_Glyph
#define Smooth_Err_Memory_Overflow Smooth_Err_Out_Of_Memory
#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory
@@ -395,10 +393,10 @@ typedef ptrdiff_t FT_PtrDist;
( sizeof( long ) * FT_CHAR_BIT - PIXEL_BITS ) )
- /*************************************************************************/
- /* */
- /* TYPE DEFINITIONS */
- /* */
+ /**************************************************************************
+ *
+ * TYPE DEFINITIONS
+ */
/* don't change the following types to FT_Int or FT_Pos, since we might */
/* need to define them to "float" or "double" when experimenting with */
@@ -516,10 +514,10 @@ typedef ptrdiff_t FT_PtrDist;
#endif /* FT_DEBUG_LEVEL_TRACE */
- /*************************************************************************/
- /* */
- /* Record the current cell in the table. */
- /* */
+ /**************************************************************************
+ *
+ * Record the current cell in the table.
+ */
static void
gray_record_cell( RAS_ARG )
{
@@ -561,10 +559,10 @@ typedef ptrdiff_t FT_PtrDist;
}
- /*************************************************************************/
- /* */
- /* Set the current cell to a new position. */
- /* */
+ /**************************************************************************
+ *
+ * Set the current cell to a new position.
+ */
static void
gray_set_cell( RAS_ARG_ TCoord ex,
TCoord ey )
@@ -598,10 +596,10 @@ typedef ptrdiff_t FT_PtrDist;
#ifndef FT_LONG64
- /*************************************************************************/
- /* */
- /* Render a scanline as one or more cells. */
- /* */
+ /**************************************************************************
+ *
+ * Render a scanline as one or more cells.
+ */
static void
gray_render_scanline( RAS_ARG_ TCoord ey,
TPos x1,
@@ -696,10 +694,10 @@ typedef ptrdiff_t FT_PtrDist;
}
- /*************************************************************************/
- /* */
- /* Render a given line as a series of scanlines. */
- /* */
+ /**************************************************************************
+ *
+ * Render a given line as a series of scanlines.
+ */
static void
gray_render_line( RAS_ARG_ TPos to_x,
TPos to_y )
@@ -837,10 +835,10 @@ typedef ptrdiff_t FT_PtrDist;
#else
- /*************************************************************************/
- /* */
- /* Render a straight line across multiple cells in any direction. */
- /* */
+ /**************************************************************************
+ *
+ * Render a straight line across multiple cells in any direction.
+ */
static void
gray_render_line( RAS_ARG_ TPos to_x,
TPos to_y )
@@ -1330,40 +1328,43 @@ typedef ptrdiff_t FT_PtrDist;
#ifdef STANDALONE_
- /*************************************************************************/
- /* */
- /* The following functions should only compile in stand-alone mode, */
- /* i.e., when building this component without the rest of FreeType. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Decompose */
- /* */
- /* <Description> */
- /* Walk over an outline's structure to decompose it into individual */
- /* segments and Bézier arcs. This function is also able to emit */
- /* `move to' and `close to' operations to indicate the start and end */
- /* of new contours in the outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source target. */
- /* */
- /* func_interface :: A table of `emitters', i.e., function pointers */
- /* called during decomposition to indicate path */
- /* operations. */
- /* */
- /* <InOut> */
- /* user :: A typeless pointer which is passed to each */
- /* emitter during the decomposition. It can be */
- /* used to store the state during the */
- /* decomposition. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * The following functions should only compile in stand-alone mode,
+ * i.e., when building this component without the rest of FreeType.
+ *
+ */
+
+ /**************************************************************************
+ *
+ * @Function:
+ * FT_Outline_Decompose
+ *
+ * @Description:
+ * Walk over an outline's structure to decompose it into individual
+ * segments and Bézier arcs. This function is also able to emit
+ * `move to' and `close to' operations to indicate the start and end
+ * of new contours in the outline.
+ *
+ * @Input:
+ * outline ::
+ * A pointer to the source target.
+ *
+ * func_interface ::
+ * A table of `emitters', i.e., function pointers
+ * called during decomposition to indicate path
+ * operations.
+ *
+ * @InOut:
+ * user ::
+ * A typeless pointer which is passed to each
+ * emitter during the decomposition. It can be
+ * used to store the state during the
+ * decomposition.
+ *
+ * @Return:
+ * Error code. 0 means success.
+ */
static int
FT_Outline_Decompose( const FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
@@ -1610,81 +1611,6 @@ typedef ptrdiff_t FT_PtrDist;
return FT_THROW( Invalid_Outline );
}
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_CBox */
- /* */
- /* <Description> */
- /* Return an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bézier 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 Bézier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component, which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <Output> */
- /* acbox :: The outline's control box. */
- /* */
- /* <Note> */
- /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
- /* */
-
- static void
- FT_Outline_Get_CBox( const FT_Outline* outline,
- FT_BBox *acbox )
- {
- TPos xMin, yMin, xMax, yMax;
-
-
- if ( outline && acbox )
- {
- if ( outline->n_points == 0 )
- {
- xMin = 0;
- yMin = 0;
- xMax = 0;
- yMax = 0;
- }
- else
- {
- FT_Vector* vec = outline->points;
- FT_Vector* limit = vec + outline->n_points;
-
-
- xMin = xMax = vec->x;
- yMin = yMax = vec->y;
- vec++;
-
- for ( ; vec < limit; vec++ )
- {
- TPos x, y;
-
-
- x = vec->x;
- if ( x < xMin ) xMin = x;
- if ( x > xMax ) xMax = x;
-
- y = vec->y;
- if ( y < yMin ) yMin = y;
- if ( y > yMax ) yMax = y;
- }
- }
- acbox->xMin = xMin;
- acbox->xMax = xMax;
- acbox->yMin = yMin;
- acbox->yMax = yMax;
- }
- }
-
#endif /* STANDALONE_ */
@@ -1702,19 +1628,20 @@ typedef ptrdiff_t FT_PtrDist;
static int
- gray_convert_glyph_inner( RAS_ARG )
+ gray_convert_glyph_inner( RAS_ARG,
+ int continued )
{
-
volatile int error = 0;
-#ifdef FT_CONFIG_OPTION_PIC
- FT_Outline_Funcs func_interface;
- Init_Class_func_interface(&func_interface);
-#endif
if ( ft_setjmp( ras.jump_buffer ) == 0 )
{
+ if ( continued )
+ FT_Trace_Disable();
error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
+ if ( continued )
+ FT_Trace_Enable();
+
if ( !ras.invalid )
gray_record_cell( RAS_VAR );
@@ -1741,8 +1668,6 @@ typedef ptrdiff_t FT_PtrDist;
{
const TCoord yMin = ras.min_ey;
const TCoord yMax = ras.max_ey;
- const TCoord xMin = ras.min_ex;
- const TCoord xMax = ras.max_ex;
TCell buffer[FT_MAX_GRAY_POOL];
size_t height = (size_t)( yMax - yMin );
@@ -1751,6 +1676,8 @@ typedef ptrdiff_t FT_PtrDist;
TCoord bands[32]; /* enough to accommodate bisections */
TCoord* band;
+ int continued = 0;
+
/* set up vertical bands */
if ( height > n )
@@ -1774,8 +1701,8 @@ typedef ptrdiff_t FT_PtrDist;
ras.max_ey = FT_MIN( y, yMax );
band = bands;
- band[1] = xMin;
- band[0] = xMax;
+ band[1] = ras.min_ey;
+ band[0] = ras.max_ey;
do
{
@@ -1787,10 +1714,11 @@ typedef ptrdiff_t FT_PtrDist;
ras.num_cells = 0;
ras.invalid = 1;
- ras.min_ex = band[1];
- ras.max_ex = band[0];
+ ras.min_ey = band[1];
+ ras.max_ey = band[0];
- error = gray_convert_glyph_inner( RAS_VAR );
+ error = gray_convert_glyph_inner( RAS_VAR, continued );
+ continued = 1;
if ( !error )
{
@@ -1827,7 +1755,7 @@ typedef ptrdiff_t FT_PtrDist;
{
const FT_Outline* outline = (const FT_Outline*)params->source;
const FT_Bitmap* target_map = params->target;
- FT_BBox cbox, clip;
+ FT_BBox clip;
#ifndef FT_STATIC_RASTER
gray_TWorker worker[1];
@@ -1890,21 +1818,11 @@ typedef ptrdiff_t FT_PtrDist;
ras.render_span_data = NULL;
}
- FT_Outline_Get_CBox( outline, &cbox );
-
- /* reject too large outline coordinates */
- if ( cbox.xMin < -0x1000000L || cbox.xMax > 0x1000000L ||
- cbox.yMin < -0x1000000L || cbox.yMax > 0x1000000L )
- return FT_THROW( Invalid_Outline );
-
- /* truncate the bounding box to integer pixels */
- cbox.xMin = cbox.xMin >> 6;
- cbox.yMin = cbox.yMin >> 6;
- cbox.xMax = ( cbox.xMax + 63 ) >> 6;
- cbox.yMax = ( cbox.yMax + 63 ) >> 6;
-
/* compute clipping box */
- if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
+ if ( params->flags & FT_RASTER_FLAG_DIRECT &&
+ params->flags & FT_RASTER_FLAG_CLIP )
+ clip = params->clip_box;
+ else
{
/* compute clip box from target pixmap */
clip.xMin = 0;
@@ -1912,21 +1830,12 @@ typedef ptrdiff_t FT_PtrDist;
clip.xMax = (FT_Pos)target_map->width;
clip.yMax = (FT_Pos)target_map->rows;
}
- else if ( params->flags & FT_RASTER_FLAG_CLIP )
- clip = params->clip_box;
- else
- {
- clip.xMin = -32768L;
- clip.yMin = -32768L;
- clip.xMax = 32767L;
- clip.yMax = 32767L;
- }
/* clip to target bitmap, exit if nothing to do */
- ras.min_ex = FT_MAX( cbox.xMin, clip.xMin );
- ras.min_ey = FT_MAX( cbox.yMin, clip.yMin );
- ras.max_ex = FT_MIN( cbox.xMax, clip.xMax );
- ras.max_ey = FT_MIN( cbox.yMax, clip.yMax );
+ ras.min_ex = clip.xMin;
+ ras.min_ey = clip.yMin;
+ ras.max_ex = clip.xMax;
+ ras.max_ey = clip.yMax;
if ( ras.max_ex <= ras.min_ex || ras.max_ey <= ras.min_ey )
return 0;
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.h b/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.h
index 9e11ca675ef..e9f9c7a4add 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.h
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/ftgrays.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftgrays.h */
-/* */
-/* FreeType smooth renderer declaration */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgrays.h
+ *
+ * FreeType smooth renderer declaration
+ *
+ * Copyright (C) 1996-2019 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 FTGRAYS_H_
@@ -28,19 +28,18 @@
#include "ftimage.h"
#else
#include <ft2build.h>
-#include FT_CONFIG_CONFIG_H /* for FT_CONFIG_OPTION_PIC */
#include FT_IMAGE_H
#endif
- /*************************************************************************/
- /* */
- /* To make ftgrays.h independent from configuration files we check */
- /* whether FT_EXPORT_VAR has been defined already. */
- /* */
- /* On some systems and compilers (Win32 mostly), an extra keyword is */
- /* necessary to compile the library as a DLL. */
- /* */
+ /**************************************************************************
+ *
+ * To make ftgrays.h independent from configuration files we check
+ * whether FT_EXPORT_VAR has been defined already.
+ *
+ * On some systems and compilers (Win32 mostly), an extra keyword is
+ * necessary to compile the library as a DLL.
+ */
#ifndef FT_EXPORT_VAR
#define FT_EXPORT_VAR( x ) extern x
#endif
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmerrs.h b/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmerrs.h
index 226dc1b0017..d52c0dd9e20 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmerrs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmerrs.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* ftsmerrs.h */
-/* */
-/* smooth renderer error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the smooth renderer error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ftsmerrs.h
+ *
+ * smooth renderer error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the smooth renderer error enumeration
+ * constants.
+ *
+ */
#ifndef FTSMERRS_H_
#define FTSMERRS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.c b/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.c
index ef176bdf1ec..c8b6bb75186 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.c
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftsmooth.c */
-/* */
-/* Anti-aliasing renderer interface (body). */
-/* */
-/* Copyright 2000-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftsmooth.c
+ *
+ * Anti-aliasing renderer interface (body).
+ *
+ * Copyright (C) 2000-2019 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 <ft2build.h>
@@ -22,7 +22,6 @@
#include FT_OUTLINE_H
#include "ftsmooth.h"
#include "ftgrays.h"
-#include "ftspic.h"
#include "ftsmerrs.h"
@@ -31,6 +30,26 @@
static FT_Error
ft_smooth_init( FT_Renderer render )
{
+
+#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+ FT_Vector* sub = render->root.library->lcd_geometry;
+
+
+ /* set up default subpixel geometry for striped RGB panels. */
+ sub[0].x = -21;
+ sub[0].y = 0;
+ sub[1].x = 0;
+ sub[1].y = 0;
+ sub[2].x = 21;
+ sub[2].y = 0;
+
+#elif 0 /* or else, once ClearType patents expire */
+
+ FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );
+
+#endif
+
render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
return 0;
@@ -130,7 +149,11 @@
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
- ft_glyphslot_preset_bitmap( slot, mode, origin );
+ if ( ft_glyphslot_preset_bitmap( slot, mode, origin ) )
+ {
+ error = FT_THROW( Raster_Overflow );
+ goto Exit;
+ }
/* allocate new one */
if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
@@ -235,33 +258,40 @@
unsigned int width = bitmap->width;
int pitch = bitmap->pitch;
+ FT_Vector* sub = slot->library->lcd_geometry;
- /* Render 3 separate monochrome bitmaps, shifting the outline */
- /* by 1/3 pixel. */
- width /= 3;
- bitmap->buffer += width;
+ /* Render 3 separate monochrome bitmaps, shifting the outline. */
+ width /= 3;
+ FT_Outline_Translate( outline,
+ -sub[0].x,
+ -sub[0].y );
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, -21, 0 );
- x_shift -= 21;
bitmap->buffer += width;
-
+ FT_Outline_Translate( outline,
+ sub[0].x - sub[1].x,
+ sub[0].y - sub[1].y );
error = render->raster_render( render->raster, &params );
+ bitmap->buffer -= width;
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 42, 0 );
- x_shift += 42;
- bitmap->buffer -= 2 * width;
-
+ bitmap->buffer += 2 * width;
+ FT_Outline_Translate( outline,
+ sub[1].x - sub[2].x,
+ sub[1].y - sub[2].y );
error = render->raster_render( render->raster, &params );
+ bitmap->buffer -= 2 * width;
if ( error )
goto Exit;
+ x_shift -= sub[2].x;
+ y_shift -= sub[2].y;
+
/* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD. */
/* XXX: It is more efficient to render every third byte above. */
@@ -286,34 +316,43 @@
{
int pitch = bitmap->pitch;
+ FT_Vector* sub = slot->library->lcd_geometry;
+
- /* Render 3 separate monochrome bitmaps, shifting the outline */
- /* by 1/3 pixel. Triple the pitch to render on each third row. */
+ /* Render 3 separate monochrome bitmaps, shifting the outline. */
+ /* Notice that the subpixel geometry vectors are rotated. */
+ /* Triple the pitch to render on each third row. */
bitmap->pitch *= 3;
bitmap->rows /= 3;
- bitmap->buffer += pitch;
-
+ FT_Outline_Translate( outline,
+ -sub[0].y,
+ sub[0].x );
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 0, 21 );
- y_shift += 21;
bitmap->buffer += pitch;
-
+ FT_Outline_Translate( outline,
+ sub[0].y - sub[1].y,
+ sub[1].x - sub[0].x );
error = render->raster_render( render->raster, &params );
+ bitmap->buffer -= pitch;
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 0, -42 );
- y_shift -= 42;
- bitmap->buffer -= 2 * pitch;
-
+ bitmap->buffer += 2 * pitch;
+ FT_Outline_Translate( outline,
+ sub[1].y - sub[2].y,
+ sub[2].x - sub[1].x );
error = render->raster_render( render->raster, &params );
+ bitmap->buffer -= 2 * pitch;
if ( error )
goto Exit;
+ x_shift -= sub[2].y;
+ y_shift += sub[2].x;
+
bitmap->pitch /= 3;
bitmap->rows *= 3;
}
@@ -403,7 +442,7 @@
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
- (FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
+ (FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
)
@@ -430,7 +469,7 @@
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
- (FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
+ (FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
)
@@ -457,7 +496,7 @@
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
- (FT_Raster_Funcs*)&FT_GRAYS_RASTER_GET /* raster_class */
+ (FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
)
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.h b/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.h
index c76ffc5034e..fbb21a31d05 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.h
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/ftsmooth.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftsmooth.h */
-/* */
-/* Anti-aliasing renderer interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftsmooth.h
+ *
+ * Anti-aliasing renderer interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 FTSMOOTH_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.c b/Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.c
deleted file mode 100644
index 10f04cf4ccf..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftspic.c */
-/* */
-/* The FreeType position independent code services for smooth module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "ftspic.h"
-#include "ftsmerrs.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from ftgrays.c */
- void
- FT_Init_Class_ft_grays_raster( FT_Raster_Funcs* funcs );
-
-
- void
- ft_smooth_renderer_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->smooth )
- {
- SmoothPIC* container = (SmoothPIC*)pic_container->smooth;
-
-
- if ( --container->ref_count )
- return;
-
- FT_FREE( container );
- pic_container->smooth = NULL;
- }
- }
-
-
- FT_Error
- ft_smooth_renderer_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- SmoothPIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* since this function also serve smooth_lcd and smooth_lcdv renderers,
- it implements reference counting */
- if ( pic_container->smooth )
- {
- ((SmoothPIC*)pic_container->smooth)->ref_count++;
- return error;
- }
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->smooth = container;
-
- container->ref_count = 1;
-
- /* initialize pointer table - */
- /* this is how the module usually expects this data */
- FT_Init_Class_ft_grays_raster( &container->ft_grays_raster );
-
- return error;
- }
-
-
- /* re-route these init and free functions to the above functions */
- FT_Error
- ft_smooth_lcd_renderer_class_pic_init( FT_Library library )
- {
- return ft_smooth_renderer_class_pic_init( library );
- }
-
-
- void
- ft_smooth_lcd_renderer_class_pic_free( FT_Library library )
- {
- ft_smooth_renderer_class_pic_free( library );
- }
-
-
- FT_Error
- ft_smooth_lcdv_renderer_class_pic_init( FT_Library library )
- {
- return ft_smooth_renderer_class_pic_init( library );
- }
-
-
- void
- ft_smooth_lcdv_renderer_class_pic_free( FT_Library library )
- {
- ft_smooth_renderer_class_pic_free( library );
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.h b/Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.h
deleted file mode 100644
index 80fb64cff43..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/ftspic.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftspic.h */
-/* */
-/* The FreeType position independent code services for smooth module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 FTSPIC_H_
-#define FTSPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-FT_BEGIN_HEADER
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_GRAYS_RASTER_GET ft_grays_raster
-
-#else /* FT_CONFIG_OPTION_PIC */
-
- typedef struct SmoothPIC_
- {
- int ref_count;
- FT_Raster_Funcs ft_grays_raster;
-
- } SmoothPIC;
-
-
-#define GET_PIC( lib ) \
- ( (SmoothPIC*)( (lib)->pic_container.smooth ) )
-#define FT_GRAYS_RASTER_GET ( GET_PIC( library )->ft_grays_raster )
-
-
- /* see ftspic.c for the implementation */
- void
- ft_smooth_renderer_class_pic_free( FT_Library library );
-
- void
- ft_smooth_lcd_renderer_class_pic_free( FT_Library library );
-
- void
- ft_smooth_lcdv_renderer_class_pic_free( FT_Library library );
-
- FT_Error
- ft_smooth_renderer_class_pic_init( FT_Library library );
-
- FT_Error
- ft_smooth_lcd_renderer_class_pic_init( FT_Library library );
-
- FT_Error
- ft_smooth_lcdv_renderer_class_pic_init( FT_Library library );
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-FT_END_HEADER
-
-#endif /* FTSPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/module.mk b/Build/source/libs/freetype2/freetype-src/src/smooth/module.mk
index 5b8bc3be3b6..44b76dfec6d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/smooth/rules.mk b/Build/source/libs/freetype2/freetype-src/src/smooth/rules.mk
index f30824a367a..0153ac24a4d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -29,8 +29,7 @@ SMOOTH_COMPILE := $(CC) $(ANSIFLAGS) \
# smooth driver sources (i.e., C files)
#
SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c \
- $(SMOOTH_DIR)/ftsmooth.c \
- $(SMOOTH_DIR)/ftspic.c
+ $(SMOOTH_DIR)/ftsmooth.c
# smooth driver headers
diff --git a/Build/source/libs/freetype2/freetype-src/src/smooth/smooth.c b/Build/source/libs/freetype2/freetype-src/src/smooth/smooth.c
index 5249a8931e3..9c543d33603 100644
--- a/Build/source/libs/freetype2/freetype-src/src/smooth/smooth.c
+++ b/Build/source/libs/freetype2/freetype-src/src/smooth/smooth.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* smooth.c */
-/* */
-/* FreeType anti-aliasing rasterer module component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * smooth.c
+ *
+ * FreeType anti-aliasing rasterer module component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -21,7 +21,6 @@
#include "ftgrays.c"
#include "ftsmooth.c"
-#include "ftspic.c"
/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/afblue.pl b/Build/source/libs/freetype2/freetype-src/src/tools/afblue.pl
index 7c6f1a7df13..937d4ecf6ed 100755
--- a/Build/source/libs/freetype2/freetype-src/src/tools/afblue.pl
+++ b/Build/source/libs/freetype2/freetype-src/src/tools/afblue.pl
@@ -5,7 +5,7 @@
#
# Process a blue zone character data file.
#
-# Copyright 2013-2018 by
+# Copyright (C) 2013-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/content.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/content.py
deleted file mode 100644
index 198780aee4f..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/content.py
+++ /dev/null
@@ -1,672 +0,0 @@
-#
-# content.py
-#
-# Parse comment blocks to build content blocks (library file).
-#
-# Copyright 2002-2018 by
-# David Turner.
-#
-# This file is part of the FreeType project, and may only be used,
-# modified, and distributed under the terms of the FreeType project
-# license, LICENSE.TXT. By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-
-#
-# This file contains routines to parse documentation comment blocks,
-# building more structured objects out of them.
-#
-
-
-from sources import *
-from utils import *
-
-import string, re
-
-
-#
-# Regular expressions to detect code sequences. `Code sequences' are simply
-# code fragments embedded in '{' and '}', as demonstrated in the following
-# example.
-#
-# {
-# x = y + z;
-# if ( zookoo == 2 )
-# {
-# foobar();
-# }
-# }
-#
-# Note that the indentation of the first opening brace and the last closing
-# brace must be exactly the same. The code sequence itself should have a
-# larger indentation than the surrounding braces.
-#
-re_code_start = re.compile( r"(\s*){\s*$" )
-re_code_end = re.compile( r"(\s*)}\s*$" )
-
-
-#
-# A regular expression to isolate identifiers from other text. Two syntax
-# forms are supported:
-#
-# <name>
-# <name>[<id>]
-#
-# where both `<name>' and `<id>' consist of alphanumeric characters, `_',
-# and `-'. Use `<id>' if there are multiple, valid `<name>' entries; in the
-# index, `<id>' will be appended in parentheses.
-#
-# For example,
-#
-# stem_darkening[autofit]
-#
-# becomes `stem_darkening (autofit)' in the index.
-#
-re_identifier = re.compile( r"""
- ((?:\w|-)+
- (?:\[(?:\w|-)+\])?)
- """, re.VERBOSE )
-
-
-#
-# We collect macro names ending in `_H' (group 1), as defined in
-# `freetype/config/ftheader.h'. While outputting the object data, we use
-# this info together with the object's file location (group 2) to emit the
-# appropriate header file macro and its associated file name before the
-# object itself.
-#
-# Example:
-#
-# #define FT_FREETYPE_H <freetype.h>
-#
-re_header_macro = re.compile( r'^#define\s{1,}(\w{1,}_H)\s{1,}<(.*)>' )
-
-
-################################################################
-##
-## DOC CODE CLASS
-##
-## The `DocCode' class is used to store source code lines.
-##
-## `self.lines' contains a set of source code lines that will be dumped as
-## HTML in a <PRE> tag.
-##
-## The object is filled line by line by the parser; it strips the leading
-## `margin' space from each input line before storing it in `self.lines'.
-##
-class DocCode:
-
- def __init__( self, margin, lines ):
- self.lines = []
- self.words = None
-
- # remove margin spaces
- for l in lines:
- if string.strip( l[:margin] ) == "":
- l = l[margin:]
- self.lines.append( l )
-
- def dump( self, prefix = "", width = 60 ):
- lines = self.dump_lines( 0, width )
- for l in lines:
- print( prefix + l )
-
- def dump_lines( self, margin = 0, width = 60 ):
- result = []
- for l in self.lines:
- result.append( " " * margin + l )
- return result
-
-
-
-################################################################
-##
-## DOC PARA CLASS
-##
-## `Normal' text paragraphs are stored in the `DocPara' class.
-##
-## `self.words' contains the list of words that make up the paragraph.
-##
-class DocPara:
-
- def __init__( self, lines ):
- self.lines = None
- self.words = []
- for l in lines:
- l = string.strip( l )
- self.words.extend( string.split( l ) )
-
- def dump( self, prefix = "", width = 60 ):
- lines = self.dump_lines( 0, width )
- for l in lines:
- print( prefix + l )
-
- def dump_lines( self, margin = 0, width = 60 ):
- cur = "" # current line
- col = 0 # current width
- result = []
-
- for word in self.words:
- ln = len( word )
- if col > 0:
- ln = ln + 1
-
- if col + ln > width:
- result.append( " " * margin + cur )
- cur = word
- col = len( word )
- else:
- if col > 0:
- cur = cur + " "
- cur = cur + word
- col = col + ln
-
- if col > 0:
- result.append( " " * margin + cur )
-
- return result
-
-
-################################################################
-##
-## DOC FIELD CLASS
-##
-## The `DocField' class stores a list containing either `DocPara' or
-## `DocCode' objects. Each DocField object also has an optional `name'
-## that is used when the object corresponds to a field or value definition.
-##
-class DocField:
-
- def __init__( self, name, lines ):
- self.name = name # can be `None' for normal paragraphs/sources
- self.items = [] # list of items
-
- mode_none = 0 # start parsing mode
- mode_code = 1 # parsing code sequences
- mode_para = 3 # parsing normal paragraph
-
- margin = -1 # current code sequence indentation
- cur_lines = []
-
- # analyze the markup lines to check whether they contain paragraphs,
- # code sequences, or fields definitions
- #
- start = 0
- mode = mode_none
-
- for l in lines:
- # are we parsing a code sequence?
- if mode == mode_code:
- m = re_code_end.match( l )
- if m and len( m.group( 1 ) ) <= margin:
- # that's it, we finished the code sequence
- code = DocCode( 0, cur_lines )
- self.items.append( code )
- margin = -1
- cur_lines = []
- mode = mode_none
- else:
- # otherwise continue the code sequence
- cur_lines.append( l[margin:] )
- else:
- # start of code sequence?
- m = re_code_start.match( l )
- if m:
- # save current lines
- if cur_lines:
- para = DocPara( cur_lines )
- self.items.append( para )
- cur_lines = []
-
- # switch to code extraction mode
- margin = len( m.group( 1 ) )
- mode = mode_code
- else:
- if not string.split( l ) and cur_lines:
- # if the line is empty, we end the current paragraph,
- # if any
- para = DocPara( cur_lines )
- self.items.append( para )
- cur_lines = []
- else:
- # otherwise, simply add the line to the current
- # paragraph
- cur_lines.append( l )
-
- if mode == mode_code:
- # unexpected end of code sequence
- code = DocCode( margin, cur_lines )
- self.items.append( code )
- elif cur_lines:
- para = DocPara( cur_lines )
- self.items.append( para )
-
- def dump( self, prefix = "" ):
- if self.field:
- print( prefix + self.field + " ::" )
- prefix = prefix + "----"
-
- first = 1
- for p in self.items:
- if not first:
- print( "" )
- p.dump( prefix )
- first = 0
-
- def dump_lines( self, margin = 0, width = 60 ):
- result = []
- nl = None
-
- for p in self.items:
- if nl:
- result.append( "" )
-
- result.extend( p.dump_lines( margin, width ) )
- nl = 1
-
- return result
-
-
-#
-# A regular expression to detect field definitions.
-#
-# Examples:
-#
-# foo ::
-# foo.bar ::
-#
-re_field = re.compile( r"""
- \s*
- (
- \w*
- |
- \w (\w | \.)* \w
- )
- \s* ::
- """, re.VERBOSE )
-
-
-################################################################
-##
-## DOC MARKUP CLASS
-##
-class DocMarkup:
-
- def __init__( self, tag, lines ):
- self.tag = string.lower( tag )
- self.fields = []
-
- cur_lines = []
- field = None
- mode = 0
-
- for l in lines:
- m = re_field.match( l )
- if m:
- # We detected the start of a new field definition.
-
- # first, save the current one
- if cur_lines:
- f = DocField( field, cur_lines )
- self.fields.append( f )
- cur_lines = []
- field = None
-
- field = m.group( 1 ) # record field name
- ln = len( m.group( 0 ) )
- l = " " * ln + l[ln:]
- cur_lines = [l]
- else:
- cur_lines.append( l )
-
- if field or cur_lines:
- f = DocField( field, cur_lines )
- self.fields.append( f )
-
- def get_name( self ):
- try:
- return self.fields[0].items[0].words[0]
- except:
- return None
-
- def dump( self, margin ):
- print( " " * margin + "<" + self.tag + ">" )
- for f in self.fields:
- f.dump( " " )
- print( " " * margin + "</" + self.tag + ">" )
-
-
-################################################################
-##
-## DOC CHAPTER CLASS
-##
-class DocChapter:
-
- def __init__( self, block ):
- self.block = block
- self.sections = []
- if block:
- self.name = block.name
- self.title = block.get_markup_words( "title" )
- self.order = block.get_markup_words( "sections" )
- else:
- self.name = "Other"
- self.title = string.split( "Miscellaneous" )
- self.order = []
-
-
-################################################################
-##
-## DOC SECTION CLASS
-##
-class DocSection:
-
- def __init__( self, name = "Other" ):
- self.name = name
- self.blocks = {}
- self.block_names = [] # ordered block names in section
- self.defs = []
- self.abstract = ""
- self.description = ""
- self.order = []
- self.title = "ERROR"
- self.chapter = None
-
- def add_def( self, block ):
- self.defs.append( block )
-
- def add_block( self, block ):
- self.block_names.append( block.name )
- self.blocks[block.name] = block
-
- def process( self ):
- # look up one block that contains a valid section description
- for block in self.defs:
- title = block.get_markup_text( "title" )
- if title:
- self.title = title
- self.abstract = block.get_markup_words( "abstract" )
- self.description = block.get_markup_items( "description" )
- self.order = block.get_markup_words_all( "order" )
- return
-
- def reorder( self ):
- self.block_names = sort_order_list( self.block_names, self.order )
-
-
-################################################################
-##
-## CONTENT PROCESSOR CLASS
-##
-class ContentProcessor:
-
- def __init__( self ):
- """Initialize a block content processor."""
- self.reset()
-
- self.sections = {} # dictionary of documentation sections
- self.section = None # current documentation section
-
- self.chapters = [] # list of chapters
-
- self.headers = {} # dictionary of header macros
-
- def set_section( self, section_name ):
- """Set current section during parsing."""
- if not section_name in self.sections:
- section = DocSection( section_name )
- self.sections[section_name] = section
- self.section = section
- else:
- self.section = self.sections[section_name]
-
- def add_chapter( self, block ):
- chapter = DocChapter( block )
- self.chapters.append( chapter )
-
- def reset( self ):
- """Reset the content processor for a new block."""
- self.markups = []
- self.markup = None
- self.markup_lines = []
-
- def add_markup( self ):
- """Add a new markup section."""
- if self.markup and self.markup_lines:
-
- # get rid of last line of markup if it's empty
- marks = self.markup_lines
- if len( marks ) > 0 and not string.strip( marks[-1] ):
- self.markup_lines = marks[:-1]
-
- m = DocMarkup( self.markup, self.markup_lines )
-
- self.markups.append( m )
-
- self.markup = None
- self.markup_lines = []
-
- def process_content( self, content ):
- """Process a block content and return a list of DocMarkup objects
- corresponding to it."""
- markup = None
- markup_lines = []
- first = 1
-
- margin = -1
- in_code = 0
-
- for line in content:
- if in_code:
- m = re_code_end.match( line )
- if m and len( m.group( 1 ) ) <= margin:
- in_code = 0
- margin = -1
- else:
- m = re_code_start.match( line )
- if m:
- in_code = 1
- margin = len( m.group( 1 ) )
-
- found = None
-
- if not in_code:
- for t in re_markup_tags:
- m = t.match( line )
- if m:
- found = string.lower( m.group( 1 ) )
- prefix = len( m.group( 0 ) )
- # remove markup from line
- line = " " * prefix + line[prefix:]
- break
-
- # is it the start of a new markup section ?
- if found:
- first = 0
- self.add_markup() # add current markup content
- self.markup = found
- if len( string.strip( line ) ) > 0:
- self.markup_lines.append( line )
- elif first == 0:
- self.markup_lines.append( line )
-
- self.add_markup()
-
- return self.markups
-
- def parse_sources( self, source_processor ):
- blocks = source_processor.blocks
- count = len( blocks )
-
- for n in range( count ):
- source = blocks[n]
- if source.content:
- # this is a documentation comment, we need to catch
- # all following normal blocks in the "follow" list
- #
- follow = []
- m = n + 1
- while m < count and not blocks[m].content:
- follow.append( blocks[m] )
- m = m + 1
-
- doc_block = DocBlock( source, follow, self )
-
- def finish( self ):
- # process all sections to extract their abstract, description
- # and ordered list of items
- #
- for sec in self.sections.values():
- sec.process()
-
- # process chapters to check that all sections are correctly
- # listed there
- for chap in self.chapters:
- for sec in chap.order:
- if sec in self.sections:
- section = self.sections[sec]
- section.chapter = chap
- section.reorder()
- chap.sections.append( section )
- else:
- sys.stderr.write( "WARNING: chapter '" + \
- chap.name + "' in " + chap.block.location() + \
- " lists unknown section '" + sec + "'\n" )
-
- # check that all sections are in a chapter
- #
- others = []
- for sec in self.sections.values():
- if not sec.chapter:
- sec.reorder()
- others.append( sec )
-
- # create a new special chapter for all remaining sections
- # when necessary
- #
- if others:
- chap = DocChapter( None )
- chap.sections = others
- self.chapters.append( chap )
-
-
-################################################################
-##
-## DOC BLOCK CLASS
-##
-class DocBlock:
-
- def __init__( self, source, follow, processor ):
- processor.reset()
-
- self.source = source
- self.code = []
- self.type = "ERRTYPE"
- self.name = "ERRNAME"
- self.section = processor.section
- self.markups = processor.process_content( source.content )
-
- # compute block type from first markup tag
- try:
- self.type = self.markups[0].tag
- except:
- pass
-
- # compute block name from first markup paragraph
- try:
- markup = self.markups[0]
- para = markup.fields[0].items[0]
- name = para.words[0]
- m = re_identifier.match( name )
- if m:
- name = m.group( 1 )
- self.name = name
- except:
- pass
-
- if self.type == "section":
- # detect new section starts
- processor.set_section( self.name )
- processor.section.add_def( self )
- elif self.type == "chapter":
- # detect new chapter
- processor.add_chapter( self )
- else:
- processor.section.add_block( self )
-
- # now, compute the source lines relevant to this documentation
- # block. We keep normal comments in for obvious reasons (??)
- source = []
- for b in follow:
- if b.format:
- break
- for l in b.lines:
- # collect header macro definitions
- m = re_header_macro.match( l )
- if m:
- processor.headers[m.group( 2 )] = m.group( 1 );
-
- # we use "/* */" as a separator
- if re_source_sep.match( l ):
- break
- source.append( l )
-
- # now strip the leading and trailing empty lines from the sources
- start = 0
- end = len( source ) - 1
-
- while start < end and not string.strip( source[start] ):
- start = start + 1
-
- while start < end and not string.strip( source[end] ):
- end = end - 1
-
- if start == end and not string.strip( source[start] ):
- self.code = []
- else:
- self.code = source[start:end + 1]
-
- def location( self ):
- return self.source.location()
-
- def get_markup( self, tag_name ):
- """Return the DocMarkup corresponding to a given tag in a block."""
- for m in self.markups:
- if m.tag == string.lower( tag_name ):
- return m
- return None
-
- def get_markup_words( self, tag_name ):
- try:
- m = self.get_markup( tag_name )
- return m.fields[0].items[0].words
- except:
- return []
-
- def get_markup_words_all( self, tag_name ):
- try:
- m = self.get_markup( tag_name )
- words = []
- for item in m.fields[0].items:
- # We honour empty lines in an `<Order>' section element by
- # adding the sentinel `/empty/'. The formatter should then
- # convert it to an appropriate representation in the
- # `section_enter' function.
- words += item.words
- words.append( "/empty/" )
- return words
- except:
- return []
-
- def get_markup_text( self, tag_name ):
- result = self.get_markup_words( tag_name )
- return string.join( result )
-
- def get_markup_items( self, tag_name ):
- try:
- m = self.get_markup( tag_name )
- return m.fields[0].items
- except:
- return None
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docbeauty.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docbeauty.py
deleted file mode 100644
index 0b021fa6c97..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docbeauty.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python
-#
-# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
-#
-# This program is used to beautify the documentation comments used
-# in the FreeType 2 public headers.
-#
-
-from sources import *
-from content import *
-from utils import *
-
-import sys, os, string, getopt
-
-
-content_processor = ContentProcessor()
-
-
-def beautify_block( block ):
- if block.content:
- content_processor.reset()
-
- markups = content_processor.process_content( block.content )
- text = []
- first = 1
-
- for markup in markups:
- text.extend( markup.beautify( first ) )
- first = 0
-
- # now beautify the documentation "borders" themselves
- lines = [" /*************************************************************************"]
- for l in text:
- lines.append( " *" + l )
- lines.append( " */" )
-
- block.lines = lines
-
-
-def usage():
- print( "\nDocBeauty 0.1 Usage information\n" )
- print( " docbeauty [options] file1 [file2 ...]\n" )
- print( "using the following options:\n" )
- print( " -h : print this page" )
- print( " -b : backup original files with the 'orig' extension" )
- print( "" )
- print( " --backup : same as -b" )
-
-
-def main( argv ):
- """main program loop"""
-
- global output_dir
-
- try:
- opts, args = getopt.getopt( sys.argv[1:], \
- "hb", \
- ["help", "backup"] )
- except getopt.GetoptError:
- usage()
- sys.exit( 2 )
-
- if args == []:
- usage()
- sys.exit( 1 )
-
- # process options
- #
- output_dir = None
- do_backup = None
-
- for opt in opts:
- if opt[0] in ( "-h", "--help" ):
- usage()
- sys.exit( 0 )
-
- if opt[0] in ( "-b", "--backup" ):
- do_backup = 1
-
- # create context and processor
- source_processor = SourceProcessor()
-
- # retrieve the list of files to process
- file_list = make_file_list( args )
- for filename in file_list:
- source_processor.parse_file( filename )
-
- for block in source_processor.blocks:
- beautify_block( block )
-
- new_name = filename + ".new"
- ok = None
-
- try:
- file = open( new_name, "wt" )
- for block in source_processor.blocks:
- for line in block.lines:
- file.write( line )
- file.write( "\n" )
- file.close()
- except:
- ok = 0
-
-
-# if called from the command line
-#
-if __name__ == '__main__':
- main( sys.argv )
-
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docmaker.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docmaker.py
deleted file mode 100644
index eb49afb0a0a..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/docmaker.py
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/env python
-#
-# docmaker.py
-#
-# Convert source code markup to HTML documentation.
-#
-# Copyright 2002-2018 by
-# David Turner.
-#
-# This file is part of the FreeType project, and may only be used,
-# modified, and distributed under the terms of the FreeType project
-# license, LICENSE.TXT. By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-
-#
-# This program is a re-write of the original DocMaker tool used to generate
-# the API Reference of the FreeType font rendering engine by converting
-# in-source comments into structured HTML.
-#
-# This new version is capable of outputting XML data as well as accepting
-# more liberal formatting options. It also uses regular expression matching
-# and substitution to speed up operation significantly.
-#
-
-from sources import *
-from content import *
-from utils import *
-from formatter import *
-from tohtml import *
-
-import utils
-
-import sys, glob, getopt
-
-
-def usage():
- print( "\nDocMaker Usage information\n" )
- print( " docmaker [options] file1 [file2 ...]\n" )
- print( "using the following options:\n" )
- print( " -h : print this page" )
- print( " -t : set project title, as in '-t \"My Project\"'" )
- print( " -o : set output directory, as in '-o mydir'" )
- print( " -p : set documentation prefix, as in '-p ft2'" )
- print( "" )
- print( " --title : same as -t, as in '--title=\"My Project\"'" )
- print( " --output : same as -o, as in '--output=mydir'" )
- print( " --prefix : same as -p, as in '--prefix=ft2'" )
-
-
-def main( argv ):
- """Main program loop."""
-
- global output_dir
-
- try:
- opts, args = getopt.getopt( sys.argv[1:],
- "ht:o:p:",
- ["help", "title=", "output=", "prefix="] )
- except getopt.GetoptError:
- usage()
- sys.exit( 2 )
-
- if args == []:
- usage()
- sys.exit( 1 )
-
- # process options
- project_title = "Project"
- project_prefix = None
- output_dir = None
-
- for opt in opts:
- if opt[0] in ( "-h", "--help" ):
- usage()
- sys.exit( 0 )
-
- if opt[0] in ( "-t", "--title" ):
- project_title = opt[1]
-
- if opt[0] in ( "-o", "--output" ):
- utils.output_dir = opt[1]
-
- if opt[0] in ( "-p", "--prefix" ):
- project_prefix = opt[1]
-
- check_output()
-
- # create context and processor
- source_processor = SourceProcessor()
- content_processor = ContentProcessor()
-
- # retrieve the list of files to process
- file_list = make_file_list( args )
- for filename in file_list:
- source_processor.parse_file( filename )
- content_processor.parse_sources( source_processor )
-
- # process sections
- content_processor.finish()
-
- formatter = HtmlFormatter( content_processor,
- project_title,
- project_prefix )
-
- formatter.toc_dump()
- formatter.index_dump()
- formatter.section_dump_all()
-
-
-# if called from the command line
-if __name__ == '__main__':
- main( sys.argv )
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/formatter.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/formatter.py
deleted file mode 100644
index 2708fd40d60..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/formatter.py
+++ /dev/null
@@ -1,228 +0,0 @@
-#
-# formatter.py
-#
-# Convert parsed content blocks to a structured document (library file).
-#
-# Copyright 2002-2018 by
-# David Turner.
-#
-# This file is part of the FreeType project, and may only be used,
-# modified, and distributed under the terms of the FreeType project
-# license, LICENSE.TXT. By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-
-#
-# This is the base Formatter class. Its purpose is to convert a content
-# processor's data into specific documents (i.e., table of contents, global
-# index, and individual API reference indices).
-#
-# You need to sub-class it to output anything sensible. For example, the
-# file `tohtml.py' contains the definition of the `HtmlFormatter' sub-class
-# to output HTML.
-#
-
-
-from sources import *
-from content import *
-from utils import *
-
-
-################################################################
-##
-## FORMATTER CLASS
-##
-class Formatter:
-
- def __init__( self, processor ):
- self.processor = processor
- self.identifiers = {}
- self.chapters = processor.chapters
- self.sections = processor.sections.values()
- self.block_index = []
-
- # store all blocks in a dictionary
- self.blocks = []
- for section in self.sections:
- for block in section.blocks.values():
- self.add_identifier( block.name, block )
-
- # add enumeration values to the index, since this is useful
- for markup in block.markups:
- if markup.tag == 'values':
- for field in markup.fields:
- self.add_identifier( field.name, block )
-
- self.block_index = self.identifiers.keys()
- self.block_index.sort( key = index_key )
-
- # also add section names to dictionary (without making them appear
- # in the index)
- for section in self.sections:
- self.add_identifier( section.name, section )
-
- def add_identifier( self, name, block ):
- if name in self.identifiers:
- # duplicate name!
- sys.stderr.write( "WARNING: duplicate definition for"
- + " '" + name + "' "
- + "in " + block.location() + ", "
- + "previous definition in "
- + self.identifiers[name].location()
- + "\n" )
- else:
- self.identifiers[name] = block
-
- #
- # formatting the table of contents
- #
- def toc_enter( self ):
- pass
-
- def toc_chapter_enter( self, chapter ):
- pass
-
- def toc_section_enter( self, section ):
- pass
-
- def toc_section_exit( self, section ):
- pass
-
- def toc_chapter_exit( self, chapter ):
- pass
-
- def toc_index( self, index_filename ):
- pass
-
- def toc_exit( self ):
- pass
-
- def toc_dump( self, toc_filename = None, index_filename = None ):
- output = None
- if toc_filename:
- output = open_output( toc_filename )
-
- self.toc_enter()
-
- for chap in self.processor.chapters:
-
- self.toc_chapter_enter( chap )
-
- for section in chap.sections:
- self.toc_section_enter( section )
- self.toc_section_exit( section )
-
- self.toc_chapter_exit( chap )
-
- self.toc_index( index_filename )
-
- self.toc_exit()
-
- if output:
- close_output( output )
-
- #
- # formatting the index
- #
- def index_enter( self ):
- pass
-
- def index_name_enter( self, name ):
- pass
-
- def index_name_exit( self, name ):
- pass
-
- def index_exit( self ):
- pass
-
- def index_dump( self, index_filename = None ):
- output = None
- if index_filename:
- output = open_output( index_filename )
-
- self.index_enter()
-
- for name in self.block_index:
- self.index_name_enter( name )
- self.index_name_exit( name )
-
- self.index_exit()
-
- if output:
- close_output( output )
-
- #
- # formatting a section
- #
- def section_enter( self, section ):
- pass
-
- def block_enter( self, block ):
- pass
-
- def markup_enter( self, markup, block = None ):
- pass
-
- def field_enter( self, field, markup = None, block = None ):
- pass
-
- def field_exit( self, field, markup = None, block = None ):
- pass
-
- def markup_exit( self, markup, block = None ):
- pass
-
- def block_exit( self, block ):
- pass
-
- def section_exit( self, section ):
- pass
-
- def section_dump( self, section, section_filename = None ):
- output = None
- if section_filename:
- output = open_output( section_filename )
-
- self.section_enter( section )
-
- for name in section.block_names:
- skip_entry = 0
- try:
- block = self.identifiers[name]
- # `block_names' can contain field names also,
- # which we filter out
- for markup in block.markups:
- if markup.tag == 'values':
- for field in markup.fields:
- if field.name == name:
- skip_entry = 1
- except:
- skip_entry = 1 # this happens e.g. for `/empty/' entries
-
- if skip_entry:
- continue
-
- self.block_enter( block )
-
- for markup in block.markups[1:]: # always ignore first markup!
- self.markup_enter( markup, block )
-
- for field in markup.fields:
- self.field_enter( field, markup, block )
- self.field_exit( field, markup, block )
-
- self.markup_exit( markup, block )
-
- self.block_exit( block )
-
- self.section_exit( section )
-
- if output:
- close_output( output )
-
- def section_dump_all( self ):
- for section in self.sections:
- self.section_dump( section )
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/sources.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/sources.py
deleted file mode 100644
index e3b95e0faa7..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/sources.py
+++ /dev/null
@@ -1,410 +0,0 @@
-#
-# sources.py
-#
-# Convert source code comments to multi-line blocks (library file).
-#
-# Copyright 2002-2018 by
-# David Turner.
-#
-# This file is part of the FreeType project, and may only be used,
-# modified, and distributed under the terms of the FreeType project
-# license, LICENSE.TXT. By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-
-#
-# This library file contains definitions of classes needed to decompose C
-# source code files into a series of multi-line `blocks'. There are two
-# kinds of blocks.
-#
-# - Normal blocks, which contain source code or ordinary comments.
-#
-# - Documentation blocks, which have restricted formatting, and whose text
-# always start with a documentation markup tag like `<Function>',
-# `<Type>', etc.
-#
-# The routines to process the content of documentation blocks are contained
-# in file `content.py'; the classes and methods found here only deal with
-# text parsing and basic documentation block extraction.
-#
-
-
-import fileinput, re, string
-
-
-################################################################
-##
-## SOURCE BLOCK FORMAT CLASS
-##
-## A simple class containing compiled regular expressions to detect
-## potential documentation format block comments within C source code.
-##
-## The `column' pattern must contain a group to `unbox' the content of
-## documentation comment blocks.
-##
-## Later on, paragraphs are converted to long lines, which simplifies the
-## regular expressions that act upon the text.
-##
-class SourceBlockFormat:
-
- def __init__( self, id, start, column, end ):
- """Create a block pattern, used to recognize special documentation
- blocks."""
- self.id = id
- self.start = re.compile( start, re.VERBOSE )
- self.column = re.compile( column, re.VERBOSE )
- self.end = re.compile( end, re.VERBOSE )
-
-
-#
-# Format 1 documentation comment blocks.
-#
-# /************************************/ (at least 2 asterisks)
-# /* */
-# /* */
-# /* */
-# /************************************/ (at least 2 asterisks)
-#
-start = r'''
- \s* # any number of whitespace
- /\*{2,}/ # followed by '/' and at least two asterisks then '/'
- \s*$ # probably followed by whitespace
-'''
-
-column = r'''
- \s* # any number of whitespace
- /\*{1} # followed by '/' and precisely one asterisk
- ([^*].*) # followed by anything (group 1)
- \*{1}/ # followed by one asterisk and a '/'
- \s*$ # probably followed by whitespace
-'''
-
-re_source_block_format1 = SourceBlockFormat( 1, start, column, start )
-
-
-#
-# Format 2 documentation comment blocks.
-#
-# /************************************ (at least 2 asterisks)
-# *
-# * (1 asterisk)
-# *
-# */ (1 or more asterisks)
-#
-start = r'''
- \s* # any number of whitespace
- /\*{2,} # followed by '/' and at least two asterisks
- \s*$ # probably followed by whitespace
-'''
-
-column = r'''
- \s* # any number of whitespace
- \*{1}(?![*/]) # followed by precisely one asterisk not followed by `/'
- (.*) # then anything (group1)
-'''
-
-end = r'''
- \s* # any number of whitespace
- \*+/ # followed by at least one asterisk, then '/'
-'''
-
-re_source_block_format2 = SourceBlockFormat( 2, start, column, end )
-
-
-#
-# The list of supported documentation block formats. We could add new ones
-# quite easily.
-#
-re_source_block_formats = [re_source_block_format1, re_source_block_format2]
-
-
-#
-# The following regular expressions correspond to markup tags within the
-# documentation comment blocks. They are equivalent despite their different
-# syntax.
-#
-# A markup tag consists of letters or character `-', to be found in group 1.
-#
-# Notice that a markup tag _must_ begin a new paragraph.
-#
-re_markup_tag1 = re.compile( r'''\s*<((?:\w|-)*)>''' ) # <xxxx> format
-re_markup_tag2 = re.compile( r'''\s*@((?:\w|-)*):''' ) # @xxxx: format
-
-#
-# The list of supported markup tags. We could add new ones quite easily.
-#
-re_markup_tags = [re_markup_tag1, re_markup_tag2]
-
-
-#
-# A regular expression to detect a cross reference, after markup tags have
-# been stripped off.
-#
-# Two syntax forms are supported:
-#
-# @<name>
-# @<name>[<id>]
-#
-# where both `<name>' and `<id>' consist of alphanumeric characters, `_',
-# and `-'. Use `<id>' if there are multiple, valid `<name>' entries.
-#
-# Example: @foo[bar]
-#
-re_crossref = re.compile( r"""
- @
- (?P<name>(?:\w|-)+
- (?:\[(?:\w|-)+\])?)
- (?P<rest>.*)
- """, re.VERBOSE )
-
-#
-# Two regular expressions to detect italic and bold markup, respectively.
-# Group 1 is the markup, group 2 the rest of the line.
-#
-# Note that the markup is limited to words consisting of letters, digits,
-# the characters `_' and `-', or an apostrophe (but not as the first
-# character).
-#
-re_italic = re.compile( r"_((?:\w|-)(?:\w|'|-)*)_(.*)" ) # _italic_
-re_bold = re.compile( r"\*((?:\w|-)(?:\w|'|-)*)\*(.*)" ) # *bold*
-
-#
-# This regular expression code to identify an URL has been taken from
-#
-# https://mail.python.org/pipermail/tutor/2002-September/017228.html
-#
-# (with slight modifications).
-#
-urls = r'(?:https?|telnet|gopher|file|wais|ftp)'
-ltrs = r'\w'
-gunk = r'/#~:.?+=&%@!\-'
-punc = r'.:?\-'
-any = "%(ltrs)s%(gunk)s%(punc)s" % { 'ltrs' : ltrs,
- 'gunk' : gunk,
- 'punc' : punc }
-url = r"""
- (
- \b # start at word boundary
- %(urls)s : # need resource and a colon
- [%(any)s] +? # followed by one or more of any valid
- # character, but be conservative and
- # take only what you need to...
- (?= # [look-ahead non-consumptive assertion]
- [%(punc)s]* # either 0 or more punctuation
- (?: # [non-grouping parentheses]
- [^%(any)s] | $ # followed by a non-url char
- # or end of the string
- )
- )
- )
- """ % {'urls' : urls,
- 'any' : any,
- 'punc' : punc }
-
-re_url = re.compile( url, re.VERBOSE | re.MULTILINE )
-
-#
-# A regular expression that stops collection of comments for the current
-# block.
-#
-re_source_sep = re.compile( r'\s*/\*\s*\*/' ) # /* */
-
-#
-# A regular expression to find possible C identifiers while outputting
-# source code verbatim, covering things like `*foo' or `(bar'. Group 1 is
-# the prefix, group 2 the identifier -- since we scan lines from left to
-# right, sequentially splitting the source code into prefix and identifier
-# is fully sufficient for our purposes.
-#
-re_source_crossref = re.compile( r'(\W*)(\w*)' )
-
-#
-# A regular expression that matches a list of reserved C source keywords.
-#
-re_source_keywords = re.compile( '''\\b ( typedef |
- struct |
- enum |
- union |
- const |
- char |
- int |
- short |
- long |
- void |
- signed |
- unsigned |
- \#include |
- \#define |
- \#undef |
- \#if |
- \#ifdef |
- \#ifndef |
- \#else |
- \#endif ) \\b''', re.VERBOSE )
-
-
-################################################################
-##
-## SOURCE BLOCK CLASS
-##
-## There are two important fields in a `SourceBlock' object.
-##
-## self.lines
-## A list of text lines for the corresponding block.
-##
-## self.content
-## For documentation comment blocks only, this is the block content
-## that has been `unboxed' from its decoration. This is `None' for all
-## other blocks (i.e., sources or ordinary comments with no starting
-## markup tag)
-##
-class SourceBlock:
-
- def __init__( self, processor, filename, lineno, lines ):
- self.processor = processor
- self.filename = filename
- self.lineno = lineno
- self.lines = lines[:]
- self.format = processor.format
- self.content = []
-
- if self.format == None:
- return
-
- words = []
-
- # extract comment lines
- lines = []
-
- for line0 in self.lines:
- m = self.format.column.match( line0 )
- if m:
- lines.append( m.group( 1 ) )
-
- # now, look for a markup tag
- for l in lines:
- l = string.strip( l )
- if len( l ) > 0:
- for tag in re_markup_tags:
- if tag.match( l ):
- self.content = lines
- return
-
- def location( self ):
- return "(" + self.filename + ":" + repr( self.lineno ) + ")"
-
- # debugging only -- not used in normal operations
- def dump( self ):
- if self.content:
- print( "{{{content start---" )
- for l in self.content:
- print( l )
- print( "---content end}}}" )
- return
-
- fmt = ""
- if self.format:
- fmt = repr( self.format.id ) + " "
-
- for line in self.lines:
- print( line )
-
-
-################################################################
-##
-## SOURCE PROCESSOR CLASS
-##
-## The `SourceProcessor' is in charge of reading a C source file and
-## decomposing it into a series of different `SourceBlock' objects.
-##
-## A SourceBlock object consists of the following data.
-##
-## - A documentation comment block using one of the layouts above. Its
-## exact format will be discussed later.
-##
-## - Normal sources lines, including comments.
-##
-##
-class SourceProcessor:
-
- def __init__( self ):
- """Initialize a source processor."""
- self.blocks = []
- self.filename = None
- self.format = None
- self.lines = []
-
- def reset( self ):
- """Reset a block processor and clean up all its blocks."""
- self.blocks = []
- self.format = None
-
- def parse_file( self, filename ):
- """Parse a C source file and add its blocks to the processor's
- list."""
- self.reset()
-
- self.filename = filename
-
- fileinput.close()
- self.format = None
- self.lineno = 0
- self.lines = []
-
- for line in fileinput.input( filename ):
- # strip trailing newlines, important on Windows machines!
- if line[-1] == '\012':
- line = line[0:-1]
-
- if self.format == None:
- self.process_normal_line( line )
- else:
- if self.format.end.match( line ):
- # A normal block end. Add it to `lines' and create a
- # new block
- self.lines.append( line )
- self.add_block_lines()
- elif self.format.column.match( line ):
- # A normal column line. Add it to `lines'.
- self.lines.append( line )
- else:
- # An unexpected block end. Create a new block, but
- # don't process the line.
- self.add_block_lines()
-
- # we need to process the line again
- self.process_normal_line( line )
-
- # record the last lines
- self.add_block_lines()
-
- def process_normal_line( self, line ):
- """Process a normal line and check whether it is the start of a new
- block."""
- for f in re_source_block_formats:
- if f.start.match( line ):
- self.add_block_lines()
- self.format = f
- self.lineno = fileinput.filelineno()
-
- self.lines.append( line )
-
- def add_block_lines( self ):
- """Add the current accumulated lines and create a new block."""
- if self.lines != []:
- block = SourceBlock( self,
- self.filename,
- self.lineno,
- self.lines )
-
- self.blocks.append( block )
- self.format = None
- self.lines = []
-
- # debugging only, not used in normal operations
- def dump( self ):
- """Print all blocks in a processor."""
- for b in self.blocks:
- b.dump()
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/tohtml.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/tohtml.py
deleted file mode 100644
index 9f318a2a494..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/tohtml.py
+++ /dev/null
@@ -1,725 +0,0 @@
-#
-# tohtml.py
-#
-# A sub-class container of the `Formatter' class to produce HTML.
-#
-# Copyright 2002-2018 by
-# David Turner.
-#
-# 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 parent class is contained in file `formatter.py'.
-
-
-from sources import *
-from content import *
-from formatter import *
-
-import time
-
-
-# The following strings define the HTML header used by all generated pages.
-html_header_1 = """\
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"https://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>\
-"""
-
-html_header_2 = """\
- API Reference</title>
-<style type="text/css">
- a:link { color: #0000EF; }
- a:visited { color: #51188E; }
- a:hover { color: #FF0000; }
-
- body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
- color: #000000;
- background: #FFFFFF;
- width: 87%;
- margin: auto; }
-
- div.section { width: 75%;
- margin: auto; }
- div.section hr { margin: 4ex 0 1ex 0; }
- div.section h4 { background-color: #EEEEFF;
- font-size: medium;
- font-style: oblique;
- font-weight: bold;
- margin: 3ex 0 1.5ex 9%;
- padding: 0.3ex 0 0.3ex 1%; }
- div.section p { margin: 1.5ex 0 1.5ex 10%; }
- div.section pre { margin: 3ex 0 3ex 9%;
- background-color: #D6E8FF;
- padding: 2ex 0 2ex 1%; }
- div.section table.fields { width: 90%;
- margin: 1.5ex 0 1.5ex 10%; }
- div.section table.toc { width: 95%;
- margin: 1.5ex 0 1.5ex 5%; }
- div.timestamp { text-align: center;
- font-size: 69%;
- margin: 1.5ex 0 1.5ex 0; }
-
- h1 { text-align: center; }
- h3 { font-size: medium;
- margin: 4ex 0 1.5ex 0; }
-
- p { text-align: justify; }
-
- pre.colored { color: blue; }
-
- span.keyword { font-family: monospace;
- text-align: left;
- white-space: pre;
- color: darkblue; }
-
- table.fields td.val { font-weight: bold;
- text-align: right;
- width: 30%;
- vertical-align: baseline;
- padding: 1ex 1em 1ex 0; }
- table.fields td.desc { vertical-align: baseline;
- padding: 1ex 0 1ex 1em; }
- table.fields td.desc p:first-child { margin: 0; }
- table.fields td.desc p { margin: 1.5ex 0 0 0; }
- table.index { margin: 6ex auto 6ex auto;
- border: 0;
- border-collapse: separate;
- border-spacing: 1em 0.3ex; }
- table.index tr { padding: 0; }
- table.index td { padding: 0; }
- table.index-toc-link { width: 100%;
- border: 0;
- border-spacing: 0;
- margin: 1ex 0 1ex 0; }
- table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
- font-size: 83%;
- text-align: left; }
- table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;
- font-size: 83%;
- text-align: center; }
- table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;
- font-size: 83%;
- text-align: right; }
- table.synopsis { margin: 6ex auto 6ex auto;
- border: 0;
- border-collapse: separate;
- border-spacing: 2em 0.6ex; }
- table.synopsis tr { padding: 0; }
- table.synopsis td { padding: 0; }
- table.toc td.link { width: 30%;
- text-align: right;
- vertical-align: baseline;
- padding: 1ex 1em 1ex 0; }
- table.toc td.desc { vertical-align: baseline;
- padding: 1ex 0 1ex 1em;
- text-align: left; }
- table.toc td.desc p:first-child { margin: 0;
- text-align: left; }
- table.toc td.desc p { margin: 1.5ex 0 0 0;
- text-align: left; }
-
-</style>
-</head>
-<body>
-"""
-
-html_header_3l = """
-<table class="index-toc-link"><tr><td class="left">[<a href="\
-"""
-
-html_header_3r = """
-<table class="index-toc-link"><tr><td class="right">[<a href="\
-"""
-
-html_header_4 = """\
-">Index</a>]</td><td class="right">[<a href="\
-"""
-
-html_header_5t = """\
-">TOC</a>]</td></tr></table>
-<h1>\
-"""
-
-html_header_5i = """\
-">Index</a>]</td></tr></table>
-<h1>\
-"""
-
-html_header_6 = """\
- API Reference</h1>
-"""
-
-
-# The HTML footer used by all generated pages.
-html_footer = """\
-</body>
-</html>\
-"""
-
-# The header and footer used for each section.
-section_title_header1 = '<h1 id="'
-section_title_header2 = '">'
-section_title_footer = "</h1>"
-
-# The header and footer used for code segments.
-code_header = '<pre class="colored">'
-code_footer = '</pre>'
-
-# Paragraph header and footer.
-para_header = "<p>"
-para_footer = "</p>"
-
-# Block header and footer.
-block_header = '<div class="section">'
-block_footer_start = """\
-<hr>
-<table class="index-toc-link"><tr><td class="left">[<a href="\
-"""
-block_footer_middle = """\
-">Index</a>]</td>\
-<td class="middle">[<a href="#">Top</a>]</td>\
-<td class="right">[<a href="\
-"""
-block_footer_end = """\
-">TOC</a>]</td></tr></table></div>
-"""
-
-# Description header/footer.
-description_header = ""
-description_footer = ""
-
-# Marker header/inter/footer combination.
-marker_header = "<h4>"
-marker_inter = "</h4>"
-marker_footer = ""
-
-# Header location header/footer.
-header_location_header = "<p>"
-header_location_footer = "</p>"
-
-# Source code extracts header/footer.
-source_header = "<pre>"
-source_footer = "</pre>"
-
-# Chapter header/inter/footer.
-chapter_header = """\
-<div class="section">
-<h2>\
-"""
-chapter_inter = '</h2>'
-chapter_footer = '</div>'
-
-# Index footer.
-index_footer_start = """\
-<hr>
-<table class="index-toc-link"><tr><td class="right">[<a href="\
-"""
-index_footer_end = """\
-">TOC</a>]</td></tr></table>
-"""
-
-# TOC footer.
-toc_footer_start = """\
-<hr>
-<table class="index-toc-link"><tr><td class="left">[<a href="\
-"""
-toc_footer_end = """\
-">Index</a>]</td></tr></table>
-"""
-
-
-# Source language keyword coloration and styling.
-keyword_prefix = '<span class="keyword">'
-keyword_suffix = '</span>'
-
-section_synopsis_header = '<h2>Synopsis</h2>'
-section_synopsis_footer = ''
-
-
-# Translate a single line of source to HTML. This converts `<', `>', and
-# `&' into `&lt;',`&gt;', and `&amp;'.
-#
-def html_quote( line ):
- result = string.replace( line, "&", "&amp;" )
- result = string.replace( result, "<", "&lt;" )
- result = string.replace( result, ">", "&gt;" )
- return result
-
-
-################################################################
-##
-## HTML FORMATTER CLASS
-##
-class HtmlFormatter( Formatter ):
-
- def __init__( self, processor, project_title, file_prefix ):
- Formatter.__init__( self, processor )
-
- global html_header_1
- global html_header_2
- global html_header_3l, html_header_3r
- global html_header_4
- global html_header_5t, html_header_5i
- global html_header_6
- global html_footer
-
- if file_prefix:
- file_prefix = file_prefix + "-"
- else:
- file_prefix = ""
-
- self.headers = processor.headers
- self.project_title = project_title
- self.file_prefix = file_prefix
- self.html_header = (
- html_header_1 + project_title
- + html_header_2
- + html_header_3l + file_prefix + "index.html"
- + html_header_4 + file_prefix + "toc.html"
- + html_header_5t + project_title
- + html_header_6 )
- self.html_index_header = (
- html_header_1 + project_title
- + html_header_2
- + html_header_3r + file_prefix + "toc.html"
- + html_header_5t + project_title
- + html_header_6 )
- self.html_toc_header = (
- html_header_1 + project_title
- + html_header_2
- + html_header_3l + file_prefix + "index.html"
- + html_header_5i + project_title
- + html_header_6 )
- self.html_footer = (
- '<div class="timestamp">generated on '
- + time.asctime( time.localtime( time.time() ) )
- + "</div>" + html_footer )
-
- self.columns = 3
-
- def make_section_url( self, section ):
- return self.file_prefix + section.name + ".html"
-
- def make_block_url( self, block, name = None ):
- if name == None:
- name = block.name
-
- try:
- section_url = self.make_section_url( block.section )
- except:
- # we already have a section
- section_url = self.make_section_url( block )
-
- return section_url + "#" + name
-
- def make_html_word( self, word ):
- """Analyze a simple word to detect cross-references and markup."""
- # handle cross-references
- m = re_crossref.match( word )
- if m:
- try:
- name = m.group( 'name' )
- rest = m.group( 'rest' )
- block = self.identifiers[name]
- url = self.make_block_url( block )
- # display `foo[bar]' as `foo'
- name = re.sub( r'\[.*\]', '', name )
- # normalize url, following RFC 3986
- url = string.replace( url, "[", "(" )
- url = string.replace( url, "]", ")" )
-
- try:
- # for sections, display title
- url = ( '&lsquo;<a href="' + url + '">'
- + block.title + '</a>&rsquo;'
- + rest )
- except:
- url = ( '<a href="' + url + '">'
- + name + '</a>'
- + rest )
-
- return url
- except:
- # we detected a cross-reference to an unknown item
- sys.stderr.write( "WARNING: undefined cross reference"
- + " '" + name + "'.\n" )
- return '?' + name + '?' + rest
-
- # handle markup for italic and bold
- m = re_italic.match( word )
- if m:
- name = m.group( 1 )
- rest = m.group( 2 )
- return '<i>' + name + '</i>' + rest
-
- m = re_bold.match( word )
- if m:
- name = m.group( 1 )
- rest = m.group( 2 )
- return '<b>' + name + '</b>' + rest
-
- return html_quote( word )
-
- def make_html_para( self, words ):
- """Convert words of a paragraph into tagged HTML text. Also handle
- cross references."""
- line = ""
- if words:
- line = self.make_html_word( words[0] )
- for word in words[1:]:
- line = line + " " + self.make_html_word( word )
- # handle hyperlinks
- line = re_url.sub( r'<a href="\1">\1</a>', line )
- # convert `...' quotations into real left and right single quotes
- line = re.sub( r"(^|\W)`(.*?)'(\W|$)",
- r'\1&lsquo;\2&rsquo;\3',
- line )
- # convert tilde into non-breakable space
- line = string.replace( line, "~", "&nbsp;" )
-
- return para_header + line + para_footer
-
- def make_html_code( self, lines ):
- """Convert a code sequence to HTML."""
- line = code_header + '\n'
- for l in lines:
- line = line + html_quote( l ).rstrip() + '\n'
-
- return line + code_footer
-
- def make_html_items( self, items ):
- """Convert a field's content into HTML."""
- lines = []
- for item in items:
- if item.lines:
- lines.append( self.make_html_code( item.lines ) )
- else:
- lines.append( self.make_html_para( item.words ) )
-
- return string.join( lines, '\n' )
-
- def print_html_items( self, items ):
- print( self.make_html_items( items ) )
-
- def print_html_field( self, field ):
- if field.name:
- print( '<table><tr valign="top"><td><b>'
- + field.name
- + "</b></td><td>" )
-
- print( self.make_html_items( field.items ) )
-
- if field.name:
- print( "</td></tr></table>" )
-
- def html_source_quote( self, line, block_name = None ):
- result = ""
- while line:
- m = re_source_crossref.match( line )
- if m:
- name = m.group( 2 )
- prefix = html_quote( m.group( 1 ) )
- length = len( m.group( 0 ) )
-
- if name == block_name:
- # this is the current block name, if any
- result = result + prefix + '<b>' + name + '</b>'
- elif re_source_keywords.match( name ):
- # this is a C keyword
- result = ( result + prefix
- + keyword_prefix + name + keyword_suffix )
- elif name in self.identifiers:
- # this is a known identifier
- block = self.identifiers[name]
- id = block.name
-
- # link to a field ID if possible
- try:
- for markup in block.markups:
- if markup.tag == 'values':
- for field in markup.fields:
- if field.name:
- id = name
-
- result = ( result + prefix
- + '<a href="'
- + self.make_block_url( block, id )
- + '">' + name + '</a>' )
- except:
- # sections don't have `markups'; however, we don't
- # want references to sections here anyway
- result = result + html_quote( line[:length] )
-
- else:
- result = result + html_quote( line[:length] )
-
- line = line[length:]
- else:
- result = result + html_quote( line )
- line = []
-
- return result
-
- def print_html_field_list( self, fields ):
- print( '<table class="fields">' )
- for field in fields:
- print( '<tr><td class="val" id="' + field.name + '">'
- + field.name
- + '</td><td class="desc">' )
- self.print_html_items( field.items )
- print( "</td></tr>" )
- print( "</table>" )
-
- def print_html_markup( self, markup ):
- table_fields = []
- for field in markup.fields:
- if field.name:
- # We begin a new series of field or value definitions. We
- # record them in the `table_fields' list before outputting
- # all of them as a single table.
- table_fields.append( field )
- else:
- if table_fields:
- self.print_html_field_list( table_fields )
- table_fields = []
-
- self.print_html_items( field.items )
-
- if table_fields:
- self.print_html_field_list( table_fields )
-
- #
- # formatting the index
- #
- def index_enter( self ):
- print( self.html_index_header )
- self.index_items = {}
-
- def index_name_enter( self, name ):
- block = self.identifiers[name]
- url = self.make_block_url( block )
- self.index_items[name] = url
-
- def index_exit( self ):
- # `block_index' already contains the sorted list of index names
- count = len( self.block_index )
- rows = ( count + self.columns - 1 ) // self.columns
-
- print( '<table class="index">' )
- for r in range( rows ):
- line = "<tr>"
- for c in range( self.columns ):
- i = r + c * rows
- if i < count:
- bname = self.block_index[r + c * rows]
- url = self.index_items[bname]
- # display `foo[bar]' as `foo (bar)'
- bname = string.replace( bname, "[", " (" )
- bname = string.replace( bname, "]", ")" )
- # normalize url, following RFC 3986
- url = string.replace( url, "[", "(" )
- url = string.replace( url, "]", ")" )
- line = ( line + '<td><a href="' + url + '">'
- + bname + '</a></td>' )
- else:
- line = line + '<td></td>'
- line = line + "</tr>"
- print( line )
-
- print( "</table>" )
-
- print( index_footer_start
- + self.file_prefix + "toc.html"
- + index_footer_end )
-
- print( self.html_footer )
-
- self.index_items = {}
-
- def index_dump( self, index_filename = None ):
- if index_filename == None:
- index_filename = self.file_prefix + "index.html"
-
- Formatter.index_dump( self, index_filename )
-
- #
- # formatting the table of contents
- #
- def toc_enter( self ):
- print( self.html_toc_header )
- print( "<h1>Table of Contents</h1>" )
-
- def toc_chapter_enter( self, chapter ):
- print( chapter_header + string.join( chapter.title ) + chapter_inter )
- print( '<table class="toc">' )
-
- def toc_section_enter( self, section ):
- print( '<tr><td class="link">'
- + '<a href="' + self.make_section_url( section ) + '">'
- + section.title + '</a></td><td class="desc">' )
- print( self.make_html_para( section.abstract ) )
-
- def toc_section_exit( self, section ):
- print( "</td></tr>" )
-
- def toc_chapter_exit( self, chapter ):
- print( "</table>" )
- print( chapter_footer )
-
- def toc_index( self, index_filename ):
- print( chapter_header
- + '<a href="' + index_filename + '">Global Index</a>'
- + chapter_inter + chapter_footer )
-
- def toc_exit( self ):
- print( toc_footer_start
- + self.file_prefix + "index.html"
- + toc_footer_end )
-
- print( self.html_footer )
-
- def toc_dump( self, toc_filename = None, index_filename = None ):
- if toc_filename == None:
- toc_filename = self.file_prefix + "toc.html"
-
- if index_filename == None:
- index_filename = self.file_prefix + "index.html"
-
- Formatter.toc_dump( self, toc_filename, index_filename )
-
- #
- # formatting sections
- #
- def section_enter( self, section ):
- print( self.html_header )
-
- print( section_title_header1 + section.name + section_title_header2
- + section.title
- + section_title_footer )
-
- maxwidth = 0
- for b in section.blocks.values():
- if len( b.name ) > maxwidth:
- maxwidth = len( b.name )
-
- width = 70 # XXX magic number
- if maxwidth > 0:
- # print section synopsis
- print( section_synopsis_header )
- print( '<table class="synopsis">' )
-
- columns = width // maxwidth
- if columns < 1:
- columns = 1
-
- count = len( section.block_names )
- # don't handle last entry if it is empty
- if section.block_names[-1] == "/empty/":
- count -= 1
- rows = ( count + columns - 1 ) // columns
-
- for r in range( rows ):
- line = "<tr>"
- for c in range( columns ):
- i = r + c * rows
- line = line + '<td>'
- if i < count:
- name = section.block_names[i]
- if name == "/empty/":
- # it can happen that a complete row is empty, and
- # without a proper `filler' the browser might
- # collapse the row to a much smaller height (or
- # even omit it completely)
- line = line + "&nbsp;"
- else:
- url = name
- # display `foo[bar]' as `foo'
- name = re.sub( r'\[.*\]', '', name )
- # normalize url, following RFC 3986
- url = string.replace( url, "[", "(" )
- url = string.replace( url, "]", ")" )
- line = ( line + '<a href="#' + url + '">'
- + name + '</a>' )
-
- line = line + '</td>'
- line = line + "</tr>"
- print( line )
-
- print( "</table>" )
- print( section_synopsis_footer )
-
- print( description_header )
- print( self.make_html_items( section.description ) )
- print( description_footer )
-
- def block_enter( self, block ):
- print( block_header )
-
- # place html anchor if needed
- if block.name:
- url = block.name
- # display `foo[bar]' as `foo'
- name = re.sub( r'\[.*\]', '', block.name )
- # normalize url, following RFC 3986
- url = string.replace( url, "[", "(" )
- url = string.replace( url, "]", ")" )
- print( '<h3 id="' + url + '">' + name + '</h3>' )
-
- # dump the block C source lines now
- if block.code:
- header = ''
- for f in self.headers.keys():
- if block.source.filename.find( f ) >= 0:
- header = self.headers[f] + ' (' + f + ')'
- break
-
-# if not header:
-# sys.stderr.write(
-# "WARNING: No header macro for"
-# + " '" + block.source.filename + "'.\n" )
-
- if header:
- print( header_location_header
- + 'Defined in ' + header + '.'
- + header_location_footer )
-
- print( source_header )
- for l in block.code:
- print( self.html_source_quote( l, block.name ) )
- print( source_footer )
-
- def markup_enter( self, markup, block ):
- if markup.tag == "description":
- print( description_header )
- else:
- print( marker_header + markup.tag + marker_inter )
-
- self.print_html_markup( markup )
-
- def markup_exit( self, markup, block ):
- if markup.tag == "description":
- print( description_footer )
- else:
- print( marker_footer )
-
- def block_exit( self, block ):
- print( block_footer_start + self.file_prefix + "index.html"
- + block_footer_middle + self.file_prefix + "toc.html"
- + block_footer_end )
-
- def section_exit( self, section ):
- print( html_footer )
-
- def section_dump_all( self ):
- for section in self.sections:
- self.section_dump( section,
- self.file_prefix + section.name + '.html' )
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/utils.py b/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/utils.py
deleted file mode 100644
index f40f1674a04..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/docmaker/utils.py
+++ /dev/null
@@ -1,127 +0,0 @@
-#
-# utils.py
-#
-# Auxiliary functions for the `docmaker' tool (library file).
-#
-# Copyright 2002-2018 by
-# David Turner.
-#
-# 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.
-
-
-import string, sys, os, glob, itertools
-
-
-# current output directory
-#
-output_dir = None
-
-
-# A function that generates a sorting key. We want lexicographical order
-# (primary key) except that capital letters are sorted before lowercase
-# ones (secondary key).
-#
-# The primary key is implemented by lowercasing the input. The secondary
-# key is simply the original data appended, character by character. For
-# example, the sort key for `FT_x' is `fFtT__xx', while the sort key for
-# `ft_X' is `fftt__xX'. Since ASCII codes of uppercase letters are
-# numerically smaller than the codes of lowercase letters, `fFtT__xx' gets
-# sorted before `fftt__xX'.
-#
-def index_key( s ):
- return string.join( itertools.chain( *zip( s.lower(), s ) ) )
-
-
-# Sort `input_list', placing the elements of `order_list' in front.
-#
-def sort_order_list( input_list, order_list ):
- new_list = order_list[:]
- for id in input_list:
- if not id in order_list:
- new_list.append( id )
- return new_list
-
-
-# Divert standard output to a given project documentation file. Use
-# `output_dir' to determine the filename location if necessary and save the
-# old stdout handle in a tuple that is returned by this function.
-#
-def open_output( filename ):
- global output_dir
-
- if output_dir and output_dir != "":
- filename = output_dir + os.sep + filename
-
- old_stdout = sys.stdout
- new_file = open( filename, "w" )
- sys.stdout = new_file
-
- return ( new_file, old_stdout )
-
-
-# Close the output that was returned by `open_output'.
-#
-def close_output( output ):
- output[0].close()
- sys.stdout = output[1]
-
-
-# Check output directory.
-#
-def check_output():
- global output_dir
- if output_dir:
- if output_dir != "":
- if not os.path.isdir( output_dir ):
- sys.stderr.write( "argument"
- + " '" + output_dir + "' "
- + "is not a valid directory\n" )
- sys.exit( 2 )
- else:
- output_dir = None
-
-
-def file_exists( pathname ):
- """Check that a given file exists."""
- result = 1
- try:
- file = open( pathname, "r" )
- file.close()
- except:
- result = None
- sys.stderr.write( pathname + " couldn't be accessed\n" )
-
- return result
-
-
-def make_file_list( args = None ):
- """Build a list of input files from command-line arguments."""
- file_list = []
- # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
-
- if not args:
- args = sys.argv[1:]
-
- for pathname in args:
- if string.find( pathname, '*' ) >= 0:
- newpath = glob.glob( pathname )
- newpath.sort() # sort files -- this is important because
- # of the order of files
- else:
- newpath = [pathname]
-
- file_list.extend( newpath )
-
- if len( file_list ) == 0:
- file_list = None
- else:
- # now filter the file list to remove non-existing ones
- file_list = filter( file_exists, file_list )
-
- return file_list
-
-# eof
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/README b/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/README
deleted file mode 100644
index 09d8e9f325e..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/README
+++ /dev/null
@@ -1,81 +0,0 @@
-ftfuzzer
-========
-
-
-ftfuzzer.cc
------------
-
-This file contains a target function for FreeType fuzzing. It can be
-used with libFuzzer (https://llvm.org/docs/LibFuzzer.html) or
-potentially any other similar fuzzer.
-
-Usage:
-
- 1. Build `libfreetype.a' and `ftfuzzer.cc' using the most recent
- clang compiler with these flags:
-
- # for fuzzer coverage feedback
- -fsanitize-coverage=edge,8bit-counters
- # for bug checking
- -fsanitize=address,signed-integer-overflow,shift
-
- You also need the header files from the `libarchive' library
- (https://www.libarchive.org/) for handling tar files (see file
- `ftmutator.cc' below for more).
-
- 2. Link with `libFuzzer' (it contains `main') and `libarchive'.
-
- 3. Run the fuzzer on some test corpus.
-
-The exact flags and commands may vary.
-
- https://github.com/google/oss-fuzz/tree/master/projects/freetype2
-
-There is a continuous fuzzing bot that runs ftfuzzer.
-
- https://oss-fuzz.com
-
-(You need an account to be able to see coverage reports and the like
-on oss-fuzz.com.)
-
-Check the bot configuration for the most current settings.
-
-
-ftmutator.cc
-------------
-
-FreeType has the ability to `attach' auxiliary files to a font file,
-providing additional information. The main usage is to load AFM files
-for PostScript Type 1 fonts.
-
-However, libFuzzer currently only supports mutation of a single input
-file. For this reason, `ftmutator.cc' contains a custom fuzzer
-mutator that uses an uncompressed tar file archive as the input. The
-first file in such a tarball gets opened by FreeType as a font, all
-other files are treated as input for `FT_Attach_Stream'.
-
-Compilation is similar to `ftfuzzer.c'.
-
-
-runinput.cc
------------
-
-To run the target function on a set of input files, this file contains
-a convenience `main' function. Link it with `ftfuzzer.cc',
-`libfreetype.a', and `libarchive' and run like
-
- ./a.out my_tests_inputs/*
-
-----------------------------------------------------------------------
-
-Copyright 2015-2018 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.
-
-
---- end of README ---
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftfuzzer.cc b/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftfuzzer.cc
deleted file mode 100644
index acf2bc98200..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftfuzzer.cc
+++ /dev/null
@@ -1,428 +0,0 @@
-// ftfuzzer.cc
-//
-// A fuzzing function to test FreeType with libFuzzer.
-//
-// Copyright 2015-2018 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.
-
-
-// we use `unique_ptr', `decltype', and other gimmicks defined since C++11
-#if __cplusplus < 201103L
-# error "a C++11 compiler is needed"
-#endif
-
-#include <archive.h>
-#include <archive_entry.h>
-
-#include <assert.h>
-#include <stdint.h>
-
-#include <memory>
-#include <vector>
-
-
- using namespace std;
-
-
-#include <ft2build.h>
-
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-#include FT_CACHE_H
-#include FT_CACHE_CHARMAP_H
-#include FT_CACHE_IMAGE_H
-#include FT_CACHE_SMALL_BITMAPS_H
-#include FT_SYNTHESIS_H
-#include FT_ADVANCES_H
-#include FT_OUTLINE_H
-#include FT_BBOX_H
-#include FT_MODULE_H
-#include FT_DRIVER_H
-#include FT_MULTIPLE_MASTERS_H
-
-
- static FT_Library library;
- static int InitResult;
-
-
- struct FT_Global
- {
- FT_Global()
- {
- InitResult = FT_Init_FreeType( &library );
- if ( InitResult )
- return;
-
- // try to activate Adobe's CFF engine; it might not be the default
- unsigned int cff_hinting_engine = FT_HINTING_ADOBE;
- FT_Property_Set( library,
- "cff",
- "hinting-engine", &cff_hinting_engine );
- }
-
- ~FT_Global()
- {
- FT_Done_FreeType( library );
- }
- };
-
- FT_Global global_ft;
-
-
- // We want to select n values at random (without repetition),
- // with 0 < n <= N. The algorithm is taken from TAoCP, Vol. 2
- // (Algorithm S, selection sampling technique)
- struct Random
- {
- int n;
- int N;
-
- int t; // total number of values so far
- int m; // number of selected values so far
-
- uint32_t r; // the current pseudo-random number
-
- Random( int n_,
- int N_ )
- : n( n_ ),
- N( N_ )
- {
- t = 0;
- m = 0;
-
- // Ideally, this should depend on the input file,
- // for example, taking the sha256 as input;
- // however, this is overkill for fuzzying tests.
- r = 12345;
- }
-
- int get()
- {
- if ( m >= n )
- return -1;
-
- Redo:
- // We can't use `rand': different C libraries might provide
- // different implementations of this function. As a replacement,
- // we use a 32bit version of the `xorshift' algorithm.
- r ^= r << 13;
- r ^= r >> 17;
- r ^= r << 5;
-
- double U = double( r ) / UINT32_MAX;
-
- if ( ( N - t ) * U >= ( n - m ) )
- {
- t++;
- goto Redo;
- }
-
- t++;
- m++;
-
- return t;
- }
- };
-
-
- static int
- archive_read_entry_data( struct archive *ar,
- vector<FT_Byte> *vw )
- {
- int r;
- const FT_Byte* buff;
- size_t size;
- int64_t offset;
-
- for (;;)
- {
- r = archive_read_data_block( ar,
- reinterpret_cast<const void**>( &buff ),
- &size,
- &offset );
- if ( r == ARCHIVE_EOF )
- return ARCHIVE_OK;
- if ( r != ARCHIVE_OK )
- return r;
-
- vw->insert( vw->end(), buff, buff + size );
- }
- }
-
-
- static vector<vector<FT_Byte>>
- parse_data( const uint8_t* data,
- size_t size )
- {
- struct archive_entry* entry;
- int r;
- vector<vector<FT_Byte>> files;
-
- unique_ptr<struct archive,
- decltype ( archive_read_free )*> a( archive_read_new(),
- archive_read_free );
-
- // activate reading of uncompressed tar archives
- archive_read_support_format_tar( a.get() );
-
- // the need for `const_cast' was removed with libarchive commit be4d4dd
- if ( !( r = archive_read_open_memory(
- a.get(),
- const_cast<void*>(static_cast<const void*>( data ) ),
- size ) ) )
- {
- unique_ptr<struct archive,
- decltype ( archive_read_close )*> a_open( a.get(),
- archive_read_close );
-
- // read files contained in archive
- for (;;)
- {
- r = archive_read_next_header( a_open.get(), &entry );
- if ( r == ARCHIVE_EOF )
- break;
- if ( r != ARCHIVE_OK )
- break;
-
- vector<FT_Byte> entry_data;
- r = archive_read_entry_data( a.get(), &entry_data );
- if ( r != ARCHIVE_OK )
- break;
-
- files.push_back( move( entry_data ) );
- }
- }
-
- if ( files.size() == 0 )
- files.emplace_back( data, data + size );
-
- return files;
- }
-
-
- static void
- setIntermediateAxis( FT_Face face )
- {
- // only handle Multiple Masters and GX variation fonts
- if ( !FT_HAS_MULTIPLE_MASTERS( face ) )
- return;
-
- // get variation data for current instance
- FT_MM_Var* variations_ptr = nullptr;
- if ( FT_Get_MM_Var( face, &variations_ptr ) )
- return;
-
- unique_ptr<FT_MM_Var,
- decltype ( free )*> variations( variations_ptr, free );
- vector<FT_Fixed> coords( variations->num_axis );
-
- // select an arbitrary instance
- for ( unsigned int i = 0; i < variations->num_axis; i++ )
- coords[i] = ( variations->axis[i].minimum +
- variations->axis[i].def ) / 2;
-
- if ( FT_Set_Var_Design_Coordinates( face,
- FT_UInt( coords.size() ),
- coords.data() ) )
- return;
- }
-
-
- // the interface function to the libFuzzer library
- extern "C" int
- LLVMFuzzerTestOneInput( const uint8_t* data,
- size_t size_ )
- {
- assert( !InitResult );
-
- if ( size_ < 1 )
- return 0;
-
- const vector<vector<FT_Byte>>& files = parse_data( data, size_ );
-
- FT_Face face;
- FT_Int32 load_flags = FT_LOAD_DEFAULT;
-#if 0
- FT_Render_Mode render_mode = FT_RENDER_MODE_NORMAL;
-#endif
-
- // We use a conservative approach here, at the cost of calling
- // `FT_New_Face' quite often. The idea is that the fuzzer should be
- // able to try all faces and named instances of a font, expecting that
- // some faces don't work for various reasons, e.g., a broken subfont, or
- // an unsupported NFNT bitmap font in a Mac dfont resource that holds
- // more than a single font.
-
- // get number of faces
- if ( FT_New_Memory_Face( library,
- files[0].data(),
- (FT_Long)files[0].size(),
- -1,
- &face ) )
- return 0;
- long num_faces = face->num_faces;
- FT_Done_Face( face );
-
- // loop over up to 20 arbitrarily selected faces
- // from index range [0;num-faces-1]
- long max_face_cnt = num_faces < 20
- ? num_faces
- : 20;
-
- Random faces_pool( (int)max_face_cnt, (int)num_faces );
-
- for ( long face_cnt = 0;
- face_cnt < max_face_cnt;
- face_cnt++ )
- {
- long face_index = faces_pool.get() - 1;
-
- // get number of instances
- if ( FT_New_Memory_Face( library,
- files[0].data(),
- (FT_Long)files[0].size(),
- -( face_index + 1 ),
- &face ) )
- continue;
- long num_instances = face->style_flags >> 16;
- FT_Done_Face( face );
-
- // loop over the face without instance (index 0)
- // and up to 20 arbitrarily selected instances
- // from index range [1;num_instances]
- long max_instance_cnt = num_instances < 20
- ? num_instances
- : 20;
-
- Random instances_pool( (int)max_instance_cnt, (int)num_instances );
-
- for ( long instance_cnt = 0;
- instance_cnt <= max_instance_cnt;
- instance_cnt++ )
- {
- long instance_index = 0;
-
- if ( !instance_cnt )
- {
- if ( FT_New_Memory_Face( library,
- files[0].data(),
- (FT_Long)files[0].size(),
- face_index,
- &face ) )
- continue;
- }
- else
- {
- instance_index = instances_pool.get();
-
- if ( FT_New_Memory_Face( library,
- files[0].data(),
- (FT_Long)files[0].size(),
- ( instance_index << 16 ) + face_index,
- &face ) )
- continue;
- }
-
- // if we have more than a single input file coming from an archive,
- // attach them (starting with the second file) using the order given
- // in the archive
- for ( size_t files_index = 1;
- files_index < files.size();
- files_index++ )
- {
- FT_Open_Args open_args = {};
- open_args.flags = FT_OPEN_MEMORY;
- open_args.memory_base = files[files_index].data();
- open_args.memory_size = (FT_Long)files[files_index].size();
-
- // the last archive element will be eventually used as the
- // attachment
- FT_Attach_Stream( face, &open_args );
- }
-
- // loop over an arbitrary size for outlines
- // and up to ten arbitrarily selected bitmap strike sizes
- // from the range [0;num_fixed_sizes - 1]
- int max_size_cnt = face->num_fixed_sizes < 10
- ? face->num_fixed_sizes
- : 10;
-
- Random sizes_pool( max_size_cnt, face->num_fixed_sizes );
-
- for ( int size_cnt = 0;
- size_cnt <= max_size_cnt;
- size_cnt++ )
- {
- FT_Int32 flags = load_flags;
-
- int size_index = 0;
-
- if ( !size_cnt )
- {
- // set up 20pt at 72dpi as an arbitrary size
- if ( FT_Set_Char_Size( face, 20 * 64, 20 * 64, 72, 72 ) )
- continue;
- flags |= FT_LOAD_NO_BITMAP;
- }
- else
- {
- // bitmap strikes are not active for font variations
- if ( instance_index )
- continue;
-
- size_index = sizes_pool.get() - 1;
-
- if ( FT_Select_Size( face, size_index ) )
- continue;
- flags |= FT_LOAD_COLOR;
- }
-
- // test MM interface only for a face without a selected instance
- // and without a selected bitmap strike
- if ( !instance_index && !size_cnt )
- setIntermediateAxis( face );
-
- // loop over all glyphs
- for ( unsigned int glyph_index = 0;
- glyph_index < (unsigned int)face->num_glyphs;
- glyph_index++ )
- {
- if ( FT_Load_Glyph( face, glyph_index, flags ) )
- continue;
-
- // Rendering is the most expensive and the least interesting part.
- //
- // if ( FT_Render_Glyph( face->glyph, render_mode) )
- // continue;
- // FT_GlyphSlot_Embolden( face->glyph );
-
-#if 0
- FT_Glyph glyph;
- if ( !FT_Get_Glyph( face->glyph, &glyph ) )
- FT_Done_Glyph( glyph );
-
- FT_Outline* outline = &face->glyph->outline;
- FT_Matrix rot30 = { 0xDDB4, -0x8000, 0x8000, 0xDDB4 };
-
- FT_Outline_Transform( outline, &rot30 );
-
- FT_BBox bbox;
- FT_Outline_Get_BBox( outline, &bbox );
-#endif
- }
- }
- FT_Done_Face( face );
- }
- }
-
- return 0;
- }
-
-
-// END
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftmutator.cc b/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftmutator.cc
deleted file mode 100644
index ae4b1404048..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/ftmutator.cc
+++ /dev/null
@@ -1,314 +0,0 @@
-// ftmutator.cc
-//
-// A custom fuzzer mutator to test for FreeType with libFuzzer.
-//
-// Copyright 2015-2018 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.
-
-
-// Since `tar' is not a valid format for input to FreeType, treat any input
-// that looks like `tar' as multiple files and mutate them separately.
-//
-// In the future, a variation of this may be used to guide mutation on a
-// logically higher level.
-
-
-// we use `unique_ptr', `decltype', and other gimmicks defined since C++11
-#if __cplusplus < 201103L
-# error "a C++11 compiler is needed"
-#endif
-
-#include <cstdint>
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <cstddef>
-#include <cstring>
-#include <iostream>
-
-#include <memory>
-#include <vector>
-
-#include <archive.h>
-#include <archive_entry.h>
-
-#include "FuzzerInterface.h"
-
-
- using namespace std;
-
-
- // This function should be defined by `ftfuzzer.cc'.
- extern "C" int
- LLVMFuzzerTestOneInput( const uint8_t* Data,
- size_t Size );
-
-
- static void
- check_result( struct archive* a,
- int r )
- {
- if ( r == ARCHIVE_OK )
- return;
-
- const char* m = archive_error_string( a );
- write( 1, m, strlen( m ) );
- exit( 1 );
- }
-
-
- static int
- archive_read_entry_data( struct archive *ar,
- vector<uint8_t> *vw )
- {
- int r;
- const uint8_t* buff;
- size_t size;
- int64_t offset;
-
- for (;;)
- {
- r = archive_read_data_block( ar,
- reinterpret_cast<const void**>( &buff ),
- &size,
- &offset );
- if ( r == ARCHIVE_EOF )
- return ARCHIVE_OK;
- if ( r != ARCHIVE_OK )
- return r;
-
- vw->insert( vw->end(), buff, buff + size );
- }
- }
-
-
- static vector<vector<uint8_t>>
- parse_data( const uint8_t* data,
- size_t size )
- {
- struct archive_entry* entry;
- int r;
- vector<vector<uint8_t>> files;
-
- unique_ptr<struct archive,
- decltype ( archive_read_free )*> a( archive_read_new(),
- archive_read_free );
-
- // activate reading of uncompressed tar archives
- archive_read_support_format_tar( a.get() );
-
- // the need for `const_cast' was removed with libarchive commit be4d4dd
- if ( !( r = archive_read_open_memory(
- a.get(),
- const_cast<void*>(static_cast<const void*>( data ) ),
- size ) ) )
- {
- unique_ptr<struct archive,
- decltype ( archive_read_close )*> a_open( a.get(),
- archive_read_close );
-
- // read files contained in archive
- for (;;)
- {
- r = archive_read_next_header( a_open.get(), &entry );
- if ( r == ARCHIVE_EOF )
- break;
- if ( r != ARCHIVE_OK )
- break;
-
- vector<uint8_t> entry_data;
- r = archive_read_entry_data( a.get(), &entry_data );
- if ( entry_data.size() == 0 )
- continue;
-
- files.push_back( move( entry_data ) );
- if ( r != ARCHIVE_OK )
- break;
- }
- }
-
- return files;
- }
-
-
- class FTFuzzer
- : public fuzzer::UserSuppliedFuzzer
- {
-
- public:
- FTFuzzer( fuzzer::FuzzerRandomBase* Rand )
- : fuzzer::UserSuppliedFuzzer( Rand ) {}
-
-
- int
- TargetFunction( const uint8_t* Data,
- size_t Size )
- {
- return LLVMFuzzerTestOneInput( Data, Size );
- }
-
-
- // Custom mutator.
- virtual size_t
- Mutate( uint8_t* Data,
- size_t Size,
- size_t MaxSize )
- {
- vector<vector<uint8_t>> files = parse_data( Data, Size );
-
- // If the file was not recognized as a tar file, treat it as non-tar.
- if ( files.size() == 0 )
- return fuzzer::UserSuppliedFuzzer::Mutate( Data, Size, MaxSize );
-
- // This is somewhat `white box' on tar. The tar format uses 512 byte
- // blocks. One block as header for each file, two empty blocks of 0's
- // at the end. File data is padded to fill its last block.
- size_t used_blocks = files.size() + 2;
- for ( const auto& file : files )
- used_blocks += ( file.size() + 511 ) / 512;
-
- size_t max_blocks = MaxSize / 512;
-
- // If the input is big, it will need to be downsized. If the original
- // tar file was too big, it may have been clipped to fit. In this
- // case it may not be possible to properly write out the data, as
- // there may not be enough space for the trailing two blocks. Start
- // dropping file data or files from the end.
- for ( size_t i = files.size();
- i-- > 1 && used_blocks > max_blocks; )
- {
- size_t blocks_to_free = used_blocks - max_blocks;
- size_t blocks_currently_used_by_file_data =
- ( files[i].size() + 511 ) / 512;
-
- if ( blocks_currently_used_by_file_data >= blocks_to_free )
- {
- files[i].resize( ( blocks_currently_used_by_file_data -
- blocks_to_free ) * 512 );
- used_blocks -= blocks_to_free;
- continue;
- }
-
- files.pop_back();
- used_blocks -= blocks_currently_used_by_file_data + 1;
- }
-
- // If we get down to one file, don't use tar.
- if ( files.size() == 1 )
- {
- memcpy( Data, files[0].data(), files[0].size() );
- return fuzzer::UserSuppliedFuzzer::Mutate( Data,
- files[0].size(),
- MaxSize );
- }
-
- size_t free_blocks = max_blocks - used_blocks;
-
- // Allow each file to use up as much of the currently available space
- // it can. If it uses or gives up blocks, add them or remove them
- // from the pool.
- for ( auto&& file : files )
- {
- size_t blocks_currently_used_by_file = ( file.size() + 511 ) / 512;
- size_t blocks_available = blocks_currently_used_by_file +
- free_blocks;
- size_t max_size = blocks_available * 512;
- size_t data_size = file.size();
-
- file.resize( max_size );
- file.resize( fuzzer::UserSuppliedFuzzer::Mutate( file.data(),
- data_size,
- max_size ) );
-
- size_t blocks_now_used_by_file = ( file.size() + 511 ) / 512;
- free_blocks = free_blocks +
- blocks_currently_used_by_file -
- blocks_now_used_by_file;
- }
-
- unique_ptr<struct archive,
- decltype ( archive_write_free )*> a( archive_write_new(),
- archive_write_free );
-
- check_result( a.get(), archive_write_add_filter_none( a.get() ) );
- check_result( a.get(), archive_write_set_format_ustar( a.get() ) );
-
- // `used' may not be correct until after the archive is closed.
- size_t used = 0xbadbeef;
- check_result( a.get(), archive_write_open_memory( a.get(),
- Data,
- MaxSize,
- &used ) );
-
- {
- unique_ptr<struct archive,
- decltype ( archive_write_close )*> a_open( a.get(),
- archive_write_close );
-
- int file_index = 0;
- for ( const auto& file : files )
- {
- unique_ptr<struct archive_entry,
- decltype ( archive_entry_free )*>
- e( archive_entry_new2( a_open.get() ),
- archive_entry_free );
-
- char name_buffer[100];
- snprintf( name_buffer, 100, "file%d", file_index++ );
-
- archive_entry_set_pathname( e.get(), name_buffer );
- archive_entry_set_size( e.get(), file.size() );
- archive_entry_set_filetype( e.get(), AE_IFREG );
- archive_entry_set_perm( e.get(), 0644 );
-
- check_result( a_open.get(),
- archive_write_header( a_open.get(), e.get() ) );
- archive_write_data( a_open.get(), file.data(), file.size() );
- check_result( a_open.get(),
- archive_write_finish_entry( a_open.get() ) );
- }
- }
-
- return used;
- }
-
-
- // Cross `Data1' and `Data2', write up to `MaxOutSize' bytes into `Out',
- // return the number of bytes written, which should be positive.
- virtual size_t
- CrossOver( const uint8_t* Data1,
- size_t Size1,
- const uint8_t* Data2,
- size_t Size2,
- uint8_t* Out,
- size_t MaxOutSize )
- {
- return fuzzer::UserSuppliedFuzzer::CrossOver( Data1,
- Size1,
- Data2,
- Size2,
- Out,
- MaxOutSize );
- }
-
- }; // end of FTFuzzer class
-
-
- int
- main( int argc,
- char* *argv )
- {
- fuzzer::FuzzerRandomLibc Rand( 0 );
- FTFuzzer F( &Rand );
-
- fuzzer::FuzzerDriver( argc, argv, F );
- }
-
-
-// END
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/rasterfuzzer.cc b/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/rasterfuzzer.cc
deleted file mode 100644
index c69b95ea0fa..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/rasterfuzzer.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-// rasterfuzzer.cc
-//
-// A fuzzing function to test FreeType's rasterizers with libFuzzer.
-//
-// Copyright 2016-2018 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 <stdint.h>
-
-#include <vector>
-
-
- using namespace std;
-
-
-#include <ft2build.h>
-
-#include FT_FREETYPE_H
-#include FT_IMAGE_H
-#include FT_OUTLINE_H
-
-
- static FT_Library library;
- static int InitResult;
-
-
- struct FT_Global {
- FT_Global() {
- InitResult = FT_Init_FreeType( &library );
- }
- ~FT_Global() {
- FT_Done_FreeType( library );
- }
- };
-
- FT_Global global_ft;
-
-
- extern "C" int
- LLVMFuzzerTestOneInput( const uint8_t* data,
- size_t size_ )
- {
- unsigned char pixels[4];
-
- FT_Bitmap bitmap_mono = {
- 1, // rows
- 1, // width
- 4, // pitch
- pixels, // buffer
- 2, // num_grays
- FT_PIXEL_MODE_MONO, // pixel_mode
- 0, // palette_mode
- NULL // palette
- };
-
- FT_Bitmap bitmap_gray = {
- 1, // rows
- 1, // width
- 4, // pitch
- pixels, // buffer
- 256, // num_grays
- FT_PIXEL_MODE_GRAY, // pixel_mode
- 0, // palette_mode
- NULL // palette
- };
-
- const size_t vsize = sizeof ( FT_Vector );
- const size_t tsize = sizeof ( char );
-
- // we use the input data for both points and tags
- short n_points = short( size_ / ( vsize + tsize ) );
- if ( n_points <= 2 )
- return 0;
-
- FT_Vector* points = reinterpret_cast<FT_Vector*>(
- const_cast<uint8_t*>(
- data ) );
- char* tags = reinterpret_cast<char*>(
- const_cast<uint8_t*>(
- data + size_t( n_points ) * vsize ) );
-
- // to reduce the number of invalid outlines that are immediately
- // rejected in `FT_Outline_Render', limit values to 2^18 pixels
- // (i.e., 2^24 bits)
- for ( short i = 0; i < n_points; i++ )
- {
- if ( points[i].x == LONG_MIN )
- points[i].x = 0;
- else if ( points[i].x < 0 )
- points[i].x = -( -points[i].x & 0xFFFFFF ) - 1;
- else
- points[i].x = ( points[i].x & 0xFFFFFF ) + 1;
-
- if ( points[i].y == LONG_MIN )
- points[i].y = 0;
- else if ( points[i].y < 0 )
- points[i].y = -( -points[i].y & 0xFFFFFF ) - 1;
- else
- points[i].y = ( points[i].y & 0xFFFFFF ) + 1;
- }
-
- short contours[1];
- contours[0] = n_points - 1;
-
- FT_Outline outline =
- {
- 1, // n_contours
- n_points, // n_points
- points, // points
- tags, // tags
- contours, // contours
- FT_OUTLINE_NONE // flags
- };
-
- FT_Outline_Get_Bitmap( library, &outline, &bitmap_mono );
- FT_Outline_Get_Bitmap( library, &outline, &bitmap_gray );
-
- return 0;
- }
-
-
-// END
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/runinput.cc b/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/runinput.cc
deleted file mode 100644
index 2b02f57580b..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/tools/ftfuzzer/runinput.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// runinput.cc
-//
-// A `main' function for fuzzers like `ftfuzzer.cc'.
-//
-// Copyright 2015-2018 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 <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-
- extern "C" void
- LLVMFuzzerTestOneInput( const uint8_t* data,
- size_t size );
-
-
- unsigned char a[1 << 24];
-
-
- int
- main( int argc,
- char* *argv )
- {
- assert( argc >= 2 );
-
- for ( int i = 1; i < argc; i++ )
- {
- fprintf( stderr, "%s\n", argv[i] );
-
- FILE* f = fopen( argv[i], "r" );
- assert( f );
-
- size_t n = fread( a, 1, sizeof ( a ), f );
- fclose( f );
- if ( !n )
- continue;
-
- unsigned char* b = (unsigned char*)malloc( n );
- memcpy( b, a, n );
-
- LLVMFuzzerTestOneInput( b, n );
-
- free( b );
- }
- }
-
-
-// END
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/glnames.py b/Build/source/libs/freetype2/freetype-src/src/tools/glnames.py
index b048d293641..e1b613d11bd 100755
--- a/Build/source/libs/freetype2/freetype-src/src/tools/glnames.py
+++ b/Build/source/libs/freetype2/freetype-src/src/tools/glnames.py
@@ -6,7 +6,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -5310,24 +5310,24 @@ def main():
mac_extras_count = len( mac_extras )
base_list = mac_extras + sid_standard_names
- write( "/***************************************************************************/\n" )
- write( "/* */\n" )
-
- write( "/* %-71s*/\n" % os.path.basename( sys.argv[1] ) )
-
- write( "/* */\n" )
- write( "/* PostScript glyph names. */\n" )
- write( "/* */\n" )
- write( "/* Copyright 2005-2018 by */\n" )
- write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" )
- write( "/* */\n" )
- write( "/* This file is part of the FreeType project, and may only be used, */\n" )
- write( "/* modified, and distributed under the terms of the FreeType project */\n" )
- write( "/* license, LICENSE.TXT. By continuing to use, modify, or distribute */\n" )
- write( "/* this file you indicate that you have read the license and */\n" )
- write( "/* understand and accept it fully. */\n" )
- write( "/* */\n" )
- write( "/***************************************************************************/\n" )
+ write( "/****************************************************************************\n" )
+ write( " *\n" )
+
+ write( " * %-71s\n" % os.path.basename( sys.argv[1] ) )
+
+ write( " *\n" )
+ write( " * PostScript glyph names.\n" )
+ write( " *\n" )
+ write( " * Copyright 2005-2019 by\n" )
+ write( " * David Turner, Robert Wilhelm, and Werner Lemberg.\n" )
+ write( " *\n" )
+ write( " * This file is part of the FreeType project, and may only be used,\n" )
+ write( " * modified, and distributed under the terms of the FreeType project\n" )
+ write( " * license, LICENSE.TXT. By continuing to use, modify, or distribute\n" )
+ write( " * this file you indicate that you have read the license and\n" )
+ write( " * understand and accept it fully.\n" )
+ write( " *\n" )
+ write( " */\n" )
write( "\n" )
write( "\n" )
write( " /* This file has been generated automatically -- do not edit! */\n" )
@@ -5361,12 +5361,12 @@ def main():
write( """\
/*
- * This table is a compressed version of the Adobe Glyph List (AGL),
- * optimized for efficient searching. It has been generated by the
- * `glnames.py' python script located in the `src/tools' directory.
+ * This table is a compressed version of the Adobe Glyph List (AGL),
+ * optimized for efficient searching. It has been generated by the
+ * `glnames.py' python script located in the `src/tools' directory.
*
- * The lookup function to get the Unicode value for a given string
- * is defined below the table.
+ * The lookup function to get the Unicode value for a given string
+ * is defined below the table.
*/
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
@@ -5380,7 +5380,7 @@ def main():
write( """\
#ifdef DEFINE_PS_TABLES
/*
- * This function searches the compressed table efficiently.
+ * This function searches the compressed table efficiently.
*/
static unsigned long
ft_get_adobe_glyph_index( const char* name,
diff --git a/Build/source/libs/freetype2/freetype-src/src/tools/update-copyright-year b/Build/source/libs/freetype2/freetype-src/src/tools/update-copyright-year
index 934f11cf028..2ae50d6f527 100755
--- a/Build/source/libs/freetype2/freetype-src/src/tools/update-copyright-year
+++ b/Build/source/libs/freetype2/freetype-src/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 2015-2018 by
+# Copyright (C) 2015-2019 by
# Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -67,7 +67,8 @@ while (<>)
s {
(?<begin>.*)
Copyright
- (?<space1>\ +)
+ (?<space1>(\ +
+ | \ +\(C\)\ +))
(?<first>[12][0-9][0-9][0-9])
(?<middle>.+)
(?<last>[12][0-9][0-9][0-9])
@@ -78,14 +79,15 @@ while (<>)
}
{
# Fill line to the same length (if appropriate); we skip the middle
- # part but insert two spaces and `-'.
+ # part but insert `(C)', three spaces, and `-'.
my $space = length($+{space1}) - 1
+ length($+{middle}) - 1
+ length($+{space2}) - 1
- + length($+{space3});
+ + length($+{space3})
+ - (length("(C)") + 1);
print "$+{begin}";
- print "Copyright\ $+{first}-$year\ by";
+ print "Copyright\ (C)\ $+{first}-$year\ by";
print ' ' x $space if length($+{end});
print "$+{end}\n";
$replaced = 1;
@@ -95,7 +97,8 @@ while (<>)
s {
(?<begin>.*)
Copyright
- (?<space1>\ +)
+ (?<space1>(\ +
+ | \ +\(C\)\ +))
(?<first>[12][0-9][0-9][0-9])
(?<space2>\ +)
by
@@ -103,7 +106,7 @@ while (<>)
(?<end>.*)
}
{
- # Fill line to the same length (if appropriate); we insert two
+ # Fill line to the same length (if appropriate); we insert three
# spaces, a `-', and the current year.
my $space = length($+{space1}) - 1
+ length($+{space2}) - 1
@@ -111,7 +114,7 @@ while (<>)
- (length($year) + 1);
print "$+{begin}";
- print "Copyright $+{first}-$year by";
+ print "Copyright\ (C)\ $+{first}-$year\ by";
# If $space is negative this inserts nothing.
print ' ' x $space if length($+{end});
print "$+{end}\n";
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/Jamfile b/Build/source/libs/freetype2/freetype-src/src/truetype/Jamfile
index e321fba14a6..2de63a7b4cc 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/truetype Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/truetype/module.mk b/Build/source/libs/freetype2/freetype-src/src/truetype/module.mk
index 16bc9c8b208..8a841cc956b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/truetype/rules.mk b/Build/source/libs/freetype2/freetype-src/src/truetype/rules.mk
index e16113f128e..df8dcd4a4ee 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -33,7 +33,6 @@ TT_DRV_SRC := $(TT_DIR)/ttdriver.c \
$(TT_DIR)/ttgxvar.c \
$(TT_DIR)/ttinterp.c \
$(TT_DIR)/ttobjs.c \
- $(TT_DIR)/ttpic.c \
$(TT_DIR)/ttpload.c \
$(TT_DIR)/ttsubpix.c
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/truetype.c b/Build/source/libs/freetype2/freetype-src/src/truetype/truetype.c
index 484370975c6..84928e7321b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/truetype.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/truetype.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* truetype.c */
-/* */
-/* FreeType TrueType driver component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * truetype.c
+ *
+ * FreeType TrueType driver component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -24,7 +24,6 @@
#include "ttgxvar.c" /* gx distortable font */
#include "ttinterp.c"
#include "ttobjs.c" /* object manager */
-#include "ttpic.c"
#include "ttpload.c" /* tables loader */
#include "ttsubpix.c"
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.c
index 820cafbb8d8..ff626d53ab9 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttdriver.c */
-/* */
-/* TrueType font driver implementation (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttdriver.c
+ *
+ * TrueType font driver implementation (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -43,20 +43,19 @@
#include "tterrors.h"
-#include "ttpic.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttdriver
+#define FT_COMPONENT ttdriver
/*
- * PROPERTY SERVICE
+ * PROPERTY SERVICE
*
*/
static FT_Error
@@ -164,38 +163,42 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_get_kerning */
- /* */
- /* <Description> */
- /* A driver method used to return the kerning vector between two */
- /* glyphs of the same face. */
- /* */
- /* <Input> */
- /* face :: A handle to the 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. */
- /* */
- /* <Output> */
- /* kerning :: The kerning vector. This is in font units for */
- /* scalable formats, and in pixels for fixed-sizes */
- /* formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this function. Other layouts, or more sophisticated */
- /* kernings, are out of scope of this method (the basic driver */
- /* interface is meant to be simple). */
- /* */
- /* They can be implemented by format-specific interfaces. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_get_kerning
+ *
+ * @Description:
+ * A driver method used to return the kerning vector between two
+ * glyphs of the same face.
+ *
+ * @Input:
+ * face ::
+ * A handle to the 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.
+ *
+ * @Output:
+ * kerning ::
+ * The kerning vector. This is in font units for
+ * scalable formats, and in pixels for fixed-sizes
+ * formats.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * @Note:
+ * Only horizontal layouts (left-to-right & right-to-left) are
+ * supported by this function. Other layouts, or more sophisticated
+ * kernings, are out of scope of this method (the basic driver
+ * interface is meant to be simple).
+ *
+ * They can be implemented by format-specific interfaces.
+ */
static FT_Error
tt_get_kerning( FT_Face ttface, /* TT_Face */
FT_UInt left_glyph,
@@ -384,32 +387,36 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_glyph_load */
- /* */
- /* <Description> */
- /* A driver method used to load a glyph within a given glyph slot. */
- /* */
- /* <Input> */
- /* slot :: A handle to the target slot object where the glyph */
- /* will be loaded. */
- /* */
- /* size :: A handle to the source face size at which the glyph */
- /* must be scaled, loaded, etc. */
- /* */
- /* glyph_index :: The index of the glyph in the font file. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_glyph_load
+ *
+ * @Description:
+ * A driver method used to load a glyph within a given glyph slot.
+ *
+ * @Input:
+ * slot ::
+ * A handle to the target slot object where the glyph
+ * will be loaded.
+ *
+ * size ::
+ * A handle to the source face size at which the glyph
+ * must be scaled, loaded, etc.
+ *
+ * glyph_index ::
+ * The index of the glyph in the font file.
+ *
+ * load_flags ::
+ * A flag indicating what to load for this glyph. The
+ * FT_LOAD_XXX constants can be used to control the
+ * glyph loading process (e.g., whether the outline
+ * should be scaled, whether to load bitmaps or not,
+ * whether to hint the outline, etc).
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
tt_glyph_load( FT_GlyphSlot ttslot, /* TT_GlyphSlot */
FT_Size ttsize, /* TT_Size */
@@ -464,7 +471,7 @@
? &ttsize->metrics
: &size->hinted_metrics;
- /* now load the glyph outline if necessary */
+ /* now fill in the glyph slot with outline/bitmap/layered */
error = TT_Load_Glyph( size, slot, glyph_index, load_flags );
/* force drop-out mode to 2 - irrelevant now */
@@ -491,17 +498,19 @@
FT_DEFINE_SERVICE_MULTIMASTERSREC(
tt_service_gx_multi_masters,
- (FT_Get_MM_Func) NULL, /* get_mm */
- (FT_Set_MM_Design_Func) NULL, /* set_mm_design */
- (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
- (FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
- (FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */
- (FT_Get_Var_Design_Func)TT_Get_Var_Design, /* get_var_design */
- (FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */
-
- (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
- (FT_Done_Blend_Func) tt_done_blend /* done_blend */
+ (FT_Get_MM_Func) NULL, /* get_mm */
+ (FT_Set_MM_Design_Func) NULL, /* set_mm_design */
+ (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
+ (FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
+ (FT_Set_Var_Design_Func) TT_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func) TT_Get_Var_Design, /* get_var_design */
+ (FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */
+ (FT_Set_MM_WeightVector_Func)NULL, /* set_mm_weightvector */
+ (FT_Get_MM_WeightVector_Func)NULL, /* get_mm_weightvector */
+
+ (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
+ (FT_Done_Blend_Func) tt_done_blend /* done_blend */
)
FT_DEFINE_SERVICE_METRICSVARIATIONSREC(
@@ -548,19 +557,19 @@
tt_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
- FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET,
- FT_SERVICE_ID_METRICS_VARIATIONS, &TT_SERVICE_METRICS_VARIATIONS_GET,
+ FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters,
+ FT_SERVICE_ID_METRICS_VARIATIONS, &tt_service_metrics_variations,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
- FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
- FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
+ FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf,
+ FT_SERVICE_ID_PROPERTIES, &tt_service_properties )
#else
FT_DEFINE_SERVICEDESCREC4(
tt_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
- FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
- FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
+ FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf,
+ FT_SERVICE_ID_PROPERTIES, &tt_service_properties )
#endif
@@ -574,26 +583,15 @@
SFNT_Service sfnt;
- /* TT_SERVICES_GET dereferences `library' in PIC mode */
-#ifdef FT_CONFIG_OPTION_PIC
- if ( !driver )
- return NULL;
- library = driver->library;
- if ( !library )
- return NULL;
-#endif
-
- result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
+ result = ft_service_list_lookup( tt_services, tt_interface );
if ( result )
return result;
-#ifndef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
-#endif
/* only return the default interface from the SFNT module */
sfntd = FT_Get_Module( library, "sfnt" );
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.h
index 707aa68edf3..3936c6a4def 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttdriver.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttdriver.h */
-/* */
-/* High-level TrueType driver interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttdriver.h
+ *
+ * High-level TrueType driver interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTDRIVER_H_
@@ -26,10 +26,8 @@
FT_BEGIN_HEADER
-
FT_DECLARE_DRIVER( tt_driver_class )
-
FT_END_HEADER
#endif /* TTDRIVER_H_ */
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/tterrors.h b/Build/source/libs/freetype2/freetype-src/src/truetype/tterrors.h
index 88bca3a04af..5609d28d689 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/tterrors.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/tterrors.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* tterrors.h */
-/* */
-/* TrueType error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the TrueType error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * tterrors.h
+ *
+ * TrueType error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the TrueType error enumeration
+ * constants.
+ *
+ */
#ifndef TTERRORS_H_
#define TTERRORS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.c
index 39d9c3f7362..cbee27aa692 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttgload.c */
-/* */
-/* TrueType Glyph Loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttgload.c
+ *
+ * TrueType Glyph Loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -38,20 +38,35 @@
#include "ttsubpix.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttgload
+#define FT_COMPONENT ttgload
- /*************************************************************************/
- /* */
- /* Composite glyph flags. */
- /* */
+ /**************************************************************************
+ *
+ * Simple glyph flags.
+ */
+#define ON_CURVE_POINT 0x01 /* same value as FT_CURVE_TAG_ON */
+#define X_SHORT_VECTOR 0x02
+#define Y_SHORT_VECTOR 0x04
+#define REPEAT_FLAG 0x08
+#define X_POSITIVE 0x10 /* two meanings depending on X_SHORT_VECTOR */
+#define SAME_X 0x10
+#define Y_POSITIVE 0x20 /* two meanings depending on Y_SHORT_VECTOR */
+#define SAME_Y 0x20
+#define OVERLAP_SIMPLE 0x40 /* we ignore this value */
+
+
+ /**************************************************************************
+ *
+ * Composite glyph flags.
+ */
#define ARGS_ARE_WORDS 0x0001
#define ARGS_ARE_XY_VALUES 0x0002
#define ROUND_XY_TO_GRID 0x0004
@@ -62,15 +77,15 @@
#define WE_HAVE_A_2X2 0x0080
#define WE_HAVE_INSTR 0x0100
#define USE_MY_METRICS 0x0200
-#define OVERLAP_COMPOUND 0x0400
+#define OVERLAP_COMPOUND 0x0400 /* we ignore this value */
#define SCALED_COMPONENT_OFFSET 0x0800
#define UNSCALED_COMPONENT_OFFSET 0x1000
- /*************************************************************************/
- /* */
- /* Return the horizontal metrics in font units for a given glyph. */
- /* */
+ /**************************************************************************
+ *
+ * Return the horizontal metrics in font units for a given glyph.
+ */
FT_LOCAL_DEF( void )
TT_Get_HMetrics( TT_Face face,
FT_UInt idx,
@@ -84,11 +99,11 @@
}
- /*************************************************************************/
- /* */
- /* Return the vertical metrics in font units for a given glyph. */
- /* See function `tt_loader_set_pp' below for explanations. */
- /* */
+ /**************************************************************************
+ *
+ * Return the vertical metrics in font units for a given glyph.
+ * See function `tt_loader_set_pp' below for explanations.
+ */
FT_LOCAL_DEF( void )
TT_Get_VMetrics( TT_Face face,
FT_UInt idx,
@@ -250,13 +265,13 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
- /*************************************************************************/
- /* */
- /* The following functions are used by default with TrueType fonts. */
- /* However, they can be replaced by alternatives if we need to support */
- /* TrueType-compressed formats (like MicroType) in the future. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * The following functions are used by default with TrueType fonts.
+ * However, they can be replaced by alternatives if we need to support
+ * TrueType-compressed formats (like MicroType) in the future.
+ *
+ */
FT_CALLBACK_DEF( FT_Error )
TT_Access_Glyph_Frame( TT_Loader loader,
@@ -267,12 +282,9 @@
FT_Error error;
FT_Stream stream = loader->stream;
- /* for non-debug mode */
FT_UNUSED( glyph_index );
- FT_TRACE4(( "Glyph %ld\n", glyph_index ));
-
/* the following line sets the `error' variable through macros! */
if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) )
return error;
@@ -337,7 +349,7 @@
FT_Byte *flag, *flag_limit;
FT_Byte c, count;
FT_Vector *vec, *vec_limit;
- FT_Pos x;
+ FT_Pos x, y;
FT_Short *cont, *cont_limit, prev_cont;
FT_Int xy_size = 0;
@@ -382,6 +394,8 @@
goto Invalid_Outline;
}
+ FT_TRACE5(( " # of points: %d\n", n_points ));
+
/* note that we will add four phantom points later */
error = FT_GLYPHLOADER_CHECK_POINTS( gloader, n_points + 4, 0 );
if ( error )
@@ -452,7 +466,7 @@
goto Invalid_Outline;
*flag++ = c = FT_NEXT_BYTE( p );
- if ( c & 8 )
+ if ( c & REPEAT_FLAG )
{
if ( p + 1 > limit )
goto Invalid_Outline;
@@ -478,31 +492,29 @@
for ( ; vec < vec_limit; vec++, flag++ )
{
- FT_Pos y = 0;
- FT_Byte f = *flag;
+ FT_Pos delta = 0;
+ FT_Byte f = *flag;
- if ( f & 2 )
+ if ( f & X_SHORT_VECTOR )
{
if ( p + 1 > limit )
goto Invalid_Outline;
- y = (FT_Pos)FT_NEXT_BYTE( p );
- if ( ( f & 16 ) == 0 )
- y = -y;
+ delta = (FT_Pos)FT_NEXT_BYTE( p );
+ if ( !( f & X_POSITIVE ) )
+ delta = -delta;
}
- else if ( ( f & 16 ) == 0 )
+ else if ( !( f & SAME_X ) )
{
if ( p + 2 > limit )
goto Invalid_Outline;
- y = (FT_Pos)FT_NEXT_SHORT( p );
+ delta = (FT_Pos)FT_NEXT_SHORT( p );
}
- x += y;
+ x += delta;
vec->x = x;
- /* the cast is for stupid compilers */
- *flag = (FT_Byte)( f & ~( 2 | 16 ) );
}
/* reading the Y coordinates */
@@ -510,35 +522,36 @@
vec = gloader->current.outline.points;
vec_limit = vec + n_points;
flag = (FT_Byte*)outline->tags;
- x = 0;
+ y = 0;
for ( ; vec < vec_limit; vec++, flag++ )
{
- FT_Pos y = 0;
- FT_Byte f = *flag;
+ FT_Pos delta = 0;
+ FT_Byte f = *flag;
- if ( f & 4 )
+ if ( f & Y_SHORT_VECTOR )
{
if ( p + 1 > limit )
goto Invalid_Outline;
- y = (FT_Pos)FT_NEXT_BYTE( p );
- if ( ( f & 32 ) == 0 )
- y = -y;
+ delta = (FT_Pos)FT_NEXT_BYTE( p );
+ if ( !( f & Y_POSITIVE ) )
+ delta = -delta;
}
- else if ( ( f & 32 ) == 0 )
+ else if ( !( f & SAME_Y ) )
{
if ( p + 2 > limit )
goto Invalid_Outline;
- y = (FT_Pos)FT_NEXT_SHORT( p );
+ delta = (FT_Pos)FT_NEXT_SHORT( p );
}
- x += y;
- vec->y = x;
+ y += delta;
+ vec->y = y;
+
/* the cast is for stupid compilers */
- *flag = (FT_Byte)( f & FT_CURVE_TAG_ON );
+ *flag = (FT_Byte)( f & ON_CURVE_POINT );
}
outline->n_points = (FT_Short)n_points;
@@ -559,9 +572,10 @@
TT_Load_Composite_Glyph( TT_Loader loader )
{
FT_Error error;
- FT_Byte* p = loader->cursor;
- FT_Byte* limit = loader->limit;
- FT_GlyphLoader gloader = loader->gloader;
+ FT_Byte* p = loader->cursor;
+ FT_Byte* limit = loader->limit;
+ FT_GlyphLoader gloader = loader->gloader;
+ FT_Long num_glyphs = loader->face->root.num_glyphs;
FT_SubGlyph subglyph;
FT_UInt num_subglyphs;
@@ -590,6 +604,11 @@
subglyph->flags = FT_NEXT_USHORT( p );
subglyph->index = FT_NEXT_USHORT( p );
+ /* we reject composites that have components */
+ /* with invalid glyph indices */
+ if ( subglyph->index >= num_glyphs )
+ goto Invalid_Composite;
+
/* check space */
count = 2;
if ( subglyph->flags & ARGS_ARE_WORDS )
@@ -768,15 +787,15 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Hint_Glyph */
- /* */
- /* <Description> */
- /* Hint the glyph using the zone prepared by the caller. Note that */
- /* the zone is supposed to include four phantom points. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Hint_Glyph
+ *
+ * @Description:
+ * Hint the glyph using the zone prepared by the caller. Note that
+ * the zone is supposed to include four phantom points.
+ */
static FT_Error
TT_Hint_Glyph( TT_Loader loader,
FT_Bool is_composite )
@@ -797,15 +816,9 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
- if ( loader->glyph->control_len > 0xFFFFL )
- {
- FT_TRACE1(( "TT_Hint_Glyph: too long instructions" ));
- FT_TRACE1(( " (0x%lx byte) is truncated\n",
- loader->glyph->control_len ));
- }
n_ins = loader->glyph->control_len;
- /* save original point position in org */
+ /* save original point positions in `org' array */
if ( n_ins > 0 )
FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points );
@@ -896,16 +909,16 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Process_Simple_Glyph */
- /* */
- /* <Description> */
- /* Once a simple glyph has been loaded, it needs to be processed. */
- /* Usually, this means scaling and hinting through bytecode */
- /* interpretation. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Process_Simple_Glyph
+ *
+ * @Description:
+ * Once a simple glyph has been loaded, it needs to be processed.
+ * Usually, this means scaling and hinting through bytecode
+ * interpretation.
+ */
static FT_Error
TT_Process_Simple_Glyph( TT_Loader loader )
{
@@ -1071,15 +1084,15 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Process_Composite_Component */
- /* */
- /* <Description> */
- /* Once a composite component has been loaded, it needs to be */
- /* processed. Usually, this means transforming and translating. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Process_Composite_Component
+ *
+ * @Description:
+ * Once a composite component has been loaded, it needs to be
+ * processed. Usually, this means transforming and translating.
+ */
static FT_Error
TT_Process_Composite_Component( TT_Loader loader,
FT_SubGlyph subglyph,
@@ -1153,10 +1166,10 @@
#if 0
- /*******************************************************************/
- /* */
- /* This algorithm is what Apple documents. But it doesn't work. */
- /* */
+ /********************************************************************
+ *
+ * This algorithm is what Apple documents. But it doesn't work.
+ */
int a = subglyph->transform.xx > 0 ? subglyph->transform.xx
: -subglyph->transform.xx;
int b = subglyph->transform.yx > 0 ? subglyph->transform.yx
@@ -1178,10 +1191,10 @@
#else /* 1 */
- /*******************************************************************/
- /* */
- /* This algorithm is a guess and works much better than the above. */
- /* */
+ /********************************************************************
+ *
+ * This algorithm is a guess and works much better than the above.
+ */
FT_Fixed mac_xscale = FT_Hypot( subglyph->transform.xx,
subglyph->transform.xy );
FT_Fixed mac_yscale = FT_Hypot( subglyph->transform.yy,
@@ -1239,16 +1252,16 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Process_Composite_Glyph */
- /* */
- /* <Description> */
- /* This is slightly different from TT_Process_Simple_Glyph, in that */
- /* its sole purpose is to hint the glyph. Thus this function is */
- /* only available when bytecode interpreter is enabled. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Process_Composite_Glyph
+ *
+ * @Description:
+ * This is slightly different from TT_Process_Simple_Glyph, in that
+ * its sole purpose is to hint the glyph. Thus this function is
+ * only available when bytecode interpreter is enabled.
+ */
static FT_Error
TT_Process_Composite_Glyph( TT_Loader loader,
FT_UInt start_point,
@@ -1460,7 +1473,7 @@
}
#endif
- use_aw_2 = (FT_Bool)( subpixel_hinting && grayscale );
+ use_aw_2 = FT_BOOL( subpixel_hinting && grayscale );
loader->pp1.x = loader->bbox.xMin - loader->left_bearing;
loader->pp1.y = 0;
@@ -1497,27 +1510,28 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* load_truetype_glyph */
- /* */
- /* <Description> */
- /* Loads a given truetype glyph. Handles composites and uses a */
- /* TT_Loader object. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * load_truetype_glyph
+ *
+ * @Description:
+ * Loads a given truetype glyph. Handles composites and uses a
+ * TT_Loader object.
+ */
static FT_Error
load_truetype_glyph( TT_Loader loader,
FT_UInt glyph_index,
FT_UInt recurse_count,
FT_Bool header_only )
{
- FT_Error error = FT_Err_Ok;
+ FT_Error error = FT_Err_Ok;
FT_Fixed x_scale, y_scale;
FT_ULong offset;
- TT_Face face = loader->face;
- FT_GlyphLoader gloader = loader->gloader;
- FT_Bool opened_frame = 0;
+ TT_Face face = loader->face;
+ FT_GlyphLoader gloader = loader->gloader;
+
+ FT_Bool opened_frame = 0;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_StreamRec inc_stream;
@@ -1550,15 +1564,15 @@
loader->glyph_index = glyph_index;
- if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
+ if ( loader->load_flags & FT_LOAD_NO_SCALE )
{
- x_scale = loader->size->metrics->x_scale;
- y_scale = loader->size->metrics->y_scale;
+ x_scale = 0x10000L;
+ y_scale = 0x10000L;
}
else
{
- x_scale = 0x10000L;
- y_scale = 0x10000L;
+ x_scale = loader->size->metrics->x_scale;
+ y_scale = loader->size->metrics->y_scale;
}
/* Set `offset' to the start of the glyph relative to the start of */
@@ -1617,38 +1631,36 @@
if ( error )
goto Exit;
- opened_frame = 1;
-
/* read glyph header first */
error = face->read_glyph_header( loader );
- if ( error )
- goto Exit;
- /* the metrics must be computed after loading the glyph header */
- /* since we need the glyph's `yMax' value in case the vertical */
- /* metrics must be emulated */
- error = tt_get_metrics( loader, glyph_index );
- if ( error )
- goto Exit;
+ face->forget_glyph_frame( loader );
- if ( header_only )
+ if ( error )
goto Exit;
}
+ /* a space glyph */
if ( loader->byte_len == 0 || loader->n_contours == 0 )
{
loader->bbox.xMin = 0;
loader->bbox.xMax = 0;
loader->bbox.yMin = 0;
loader->bbox.yMax = 0;
+ }
- error = tt_get_metrics( loader, glyph_index );
- if ( error )
- goto Exit;
+ /* the metrics must be computed after loading the glyph header */
+ /* since we need the glyph's `yMax' value in case the vertical */
+ /* metrics must be emulated */
+ error = tt_get_metrics( loader, glyph_index );
+ if ( error )
+ goto Exit;
- if ( header_only )
- goto Exit;
+ if ( header_only )
+ goto Exit;
+ if ( loader->byte_len == 0 || loader->n_contours == 0 )
+ {
/* must initialize points before (possibly) overriding */
/* glyph metrics from the incremental interface */
tt_loader_set_pp( loader );
@@ -1704,7 +1716,6 @@
loader->pp4.x = points[3].x;
loader->pp4.y = points[3].y;
-
/* recalculate linear horizontal and vertical advances */
/* if we don't have HVAR and VVAR, respectively */
if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
@@ -1745,6 +1756,16 @@
/***********************************************************************/
/***********************************************************************/
+ /* we now open a frame again, right after the glyph header */
+ /* (which consists of 10 bytes) */
+ error = face->access_glyph_frame( loader, glyph_index,
+ face->glyf_offset + offset + 10,
+ (FT_UInt)loader->byte_len - 10 );
+ if ( error )
+ goto Exit;
+
+ opened_frame = 1;
+
/* if it is a simple glyph, load it */
if ( loader->n_contours > 0 )
@@ -1790,7 +1811,6 @@
* pointers with a width of at least 32 bits.
*/
-
/* clear the nodes filled by sibling chains */
node = ft_list_get_node_at( &loader->composites, recurse_count );
for ( node2 = node; node2; node2 = node2->next )
@@ -2002,7 +2022,7 @@
FT_Int linear_vadvance;
- /* Each time we call load_truetype_glyph in this loop, the */
+ /* Each time we call `load_truetype_glyph' in this loop, the */
/* value of `gloader.base.subglyphs' can change due to table */
/* reallocations. We thus need to recompute the subglyph */
/* pointer on each iteration. */
@@ -2045,12 +2065,14 @@
if ( num_points == num_base_points )
continue;
- /* gloader->base.outline consists of three parts: */
- /* 0 -(1)-> start_point -(2)-> num_base_points -(3)-> n_points. */
- /* */
- /* (1): exists from the beginning */
- /* (2): components that have been loaded so far */
- /* (3): the newly loaded component */
+ /* gloader->base.outline consists of three parts: */
+ /* */
+ /* 0 ----> start_point ----> num_base_points ----> n_points */
+ /* (1) (2) (3) */
+ /* */
+ /* (1) points that exist from the beginning */
+ /* (2) component points that have been loaded so far */
+ /* (3) points of the newly loaded component */
error = TT_Process_Composite_Component( loader,
subglyph,
start_point,
@@ -2132,7 +2154,7 @@
glyph->metrics.horiBearingX = bbox.xMin;
glyph->metrics.horiBearingY = bbox.yMax;
- glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
+ 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 */
@@ -2276,13 +2298,13 @@
/* XXX: for now, we have no better algorithm for the lsb, but it */
/* should work fine. */
/* */
- glyph->metrics.vertBearingX = glyph->metrics.horiBearingX -
- glyph->metrics.horiAdvance / 2;
+ glyph->metrics.vertBearingX = SUB_LONG( glyph->metrics.horiBearingX,
+ glyph->metrics.horiAdvance / 2 );
glyph->metrics.vertBearingY = top;
glyph->metrics.vertAdvance = advance;
}
- return 0;
+ return FT_Err_Ok;
}
@@ -2656,33 +2678,37 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Load_Glyph */
- /* */
- /* <Description> */
- /* A function used to load a single glyph within a given glyph slot, */
- /* for a given size. */
- /* */
- /* <Input> */
- /* glyph :: A handle to a target slot object where the glyph */
- /* will be loaded. */
- /* */
- /* size :: A handle to the source face size at which the glyph */
- /* must be scaled/loaded. */
- /* */
- /* glyph_index :: The index of the glyph in the font file. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Load_Glyph
+ *
+ * @Description:
+ * A function used to load a single glyph within a given glyph slot,
+ * for a given size.
+ *
+ * @Input:
+ * glyph ::
+ * A handle to a target slot object where the glyph
+ * will be loaded.
+ *
+ * size ::
+ * A handle to the source face size at which the glyph
+ * must be scaled/loaded.
+ *
+ * glyph_index ::
+ * The index of the glyph in the font file.
+ *
+ * load_flags ::
+ * A flag indicating what to load for this glyph. The
+ * FT_LOAD_XXX constants can be used to control the
+ * glyph loading process (e.g., whether the outline
+ * should be scaled, whether to load bitmaps or not,
+ * whether to hint the outline, etc).
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Load_Glyph( TT_Size size,
TT_GlyphSlot glyph,
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.h
index d237cfd2841..f1324bc8621 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttgload.h */
-/* */
-/* TrueType Glyph Loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttgload.h
+ *
+ * TrueType Glyph Loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTGLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.c
index 29ab2a4efdd..020918f5336 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.c
@@ -1,42 +1,42 @@
-/***************************************************************************/
-/* */
-/* ttgxvar.c */
-/* */
-/* TrueType GX Font Variation loader */
-/* */
-/* Copyright 2004-2018 by */
-/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Apple documents the `fvar', `gvar', `cvar', and `avar' tables at */
- /* */
- /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6[fgca]var.html */
- /* */
- /* The documentation for `gvar' is not intelligible; `cvar' refers you */
- /* to `gvar' and is thus also incomprehensible. */
- /* */
- /* The documentation for `avar' appears correct, but Apple has no fonts */
- /* with an `avar' table, so it is hard to test. */
- /* */
- /* Many thanks to John Jenkins (at Apple) in figuring this out. */
- /* */
- /* */
- /* Apple's `kern' table has some references to tuple indices, but as */
- /* there is no indication where these indices are defined, nor how to */
- /* interpolate the kerning values (different tuples have different */
- /* classes) this issue is ignored. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * ttgxvar.c
+ *
+ * TrueType GX Font Variation loader
+ *
+ * Copyright (C) 2004-2019 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
+ *
+ * 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.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * Apple documents the `fvar', `gvar', `cvar', and `avar' tables at
+ *
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6[fgca]var.html
+ *
+ * The documentation for `gvar' is not intelligible; `cvar' refers you
+ * to `gvar' and is thus also incomprehensible.
+ *
+ * The documentation for `avar' appears correct, but Apple has no fonts
+ * with an `avar' table, so it is hard to test.
+ *
+ * Many thanks to John Jenkins (at Apple) in figuring this out.
+ *
+ *
+ * Apple's `kern' table has some references to tuple indices, but as
+ * there is no indication where these indices are defined, nor how to
+ * interpolate the kerning values (different tuples have different
+ * classes) this issue is ignored.
+ *
+ */
#include <ft2build.h>
@@ -67,14 +67,23 @@
: (stream)->limit
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /* some macros we need */
+#define FT_fdot14ToFixed( x ) \
+ ( (FT_Fixed)( (FT_ULong)(x) << 2 ) )
+#define FT_intToFixed( i ) \
+ ( (FT_Fixed)( (FT_ULong)(i) << 16 ) )
+#define FT_fixedToInt( x ) \
+ ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
+
+
+ /**************************************************************************
+ *
+ * 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 trace_ttgxvar
+#define FT_COMPONENT ttgxvar
/*************************************************************************/
@@ -86,12 +95,12 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* The macro ALL_POINTS is used in `ft_var_readpackedpoints'. It */
- /* indicates that there is a delta for every point without needing to */
- /* enumerate all of them. */
- /* */
+ /**************************************************************************
+ *
+ * The macro ALL_POINTS is used in `ft_var_readpackedpoints'. It
+ * indicates that there is a delta for every point without needing to
+ * enumerate all of them.
+ */
/* ensure that value `0' has the same width as a pointer */
#define ALL_POINTS (FT_UShort*)~(FT_PtrDist)0
@@ -101,29 +110,32 @@
#define GX_PT_POINT_RUN_COUNT_MASK 0x7FU
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_readpackedpoints */
- /* */
- /* <Description> */
- /* Read a set of points to which the following deltas will apply. */
- /* Points are packed with a run length encoding. */
- /* */
- /* <Input> */
- /* stream :: The data stream. */
- /* */
- /* size :: The size of the table holding the data. */
- /* */
- /* <Output> */
- /* point_cnt :: The number of points read. A zero value means that */
- /* all points in the glyph will be affected, without */
- /* enumerating them individually. */
- /* */
- /* <Return> */
- /* An array of FT_UShort containing the affected points or the */
- /* special value ALL_POINTS. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_readpackedpoints
+ *
+ * @Description:
+ * Read a set of points to which the following deltas will apply.
+ * Points are packed with a run length encoding.
+ *
+ * @Input:
+ * stream ::
+ * The data stream.
+ *
+ * size ::
+ * The size of the table holding the data.
+ *
+ * @Output:
+ * point_cnt ::
+ * The number of points read. A zero value means that
+ * all points in the glyph will be affected, without
+ * enumerating them individually.
+ *
+ * @Return:
+ * An array of FT_UShort containing the affected points or the
+ * special value ALL_POINTS.
+ */
static FT_UShort*
ft_var_readpackedpoints( FT_Stream stream,
FT_ULong size,
@@ -211,34 +223,41 @@
#define GX_DT_DELTA_RUN_COUNT_MASK 0x3FU
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_readpackeddeltas */
- /* */
- /* <Description> */
- /* Read a set of deltas. These are packed slightly differently than */
- /* points. In particular there is no overall count. */
- /* */
- /* <Input> */
- /* stream :: The data stream. */
- /* */
- /* size :: The size of the table holding the data. */
- /* */
- /* delta_cnt :: The number of deltas to be read. */
- /* */
- /* <Return> */
- /* An array of FT_Short containing the deltas for the affected */
- /* points. (This only gets the deltas for one dimension. It will */
- /* generally be called twice, once for x, once for y. When used in */
- /* cvt table, it will only be called once.) */
- /* */
- static FT_Short*
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_readpackeddeltas
+ *
+ * @Description:
+ * Read a set of deltas. These are packed slightly differently than
+ * points. In particular there is no overall count.
+ *
+ * @Input:
+ * stream ::
+ * The data stream.
+ *
+ * size ::
+ * The size of the table holding the data.
+ *
+ * delta_cnt ::
+ * The number of deltas to be read.
+ *
+ * @Return:
+ * An array of FT_Fixed containing the deltas for the affected
+ * points. (This only gets the deltas for one dimension. It will
+ * generally be called twice, once for x, once for y. When used in
+ * cvt table, it will only be called once.)
+ *
+ * We use FT_Fixed to avoid accumulation errors while summing up all
+ * deltas (the rounding to integer values happens as the very last
+ * step).
+ */
+ static FT_Fixed*
ft_var_readpackeddeltas( FT_Stream stream,
FT_ULong size,
FT_UInt delta_cnt )
{
- FT_Short *deltas = NULL;
+ FT_Fixed *deltas = NULL;
FT_UInt runcnt, cnt;
FT_UInt i, j;
FT_Memory memory = stream->memory;
@@ -272,13 +291,13 @@
{
/* `runcnt' shorts from the stack */
for ( j = 0; j <= cnt && i < delta_cnt; j++ )
- deltas[i++] = FT_GET_SHORT();
+ deltas[i++] = FT_intToFixed( FT_GET_SHORT() );
}
else
{
/* `runcnt' signed bytes from the stack */
for ( j = 0; j <= cnt && i < delta_cnt; j++ )
- deltas[i++] = FT_GET_CHAR();
+ deltas[i++] = FT_intToFixed( FT_GET_CHAR() );
}
if ( j <= cnt )
@@ -293,18 +312,19 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_load_avar */
- /* */
- /* <Description> */
- /* Parse the `avar' table if present. It need not be, so we return */
- /* nothing. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_load_avar
+ *
+ * @Description:
+ * Parse the `avar' table if present. It need not be, so we return
+ * nothing.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ */
static void
ft_var_load_avar( TT_Face face )
{
@@ -394,17 +414,6 @@
}
- /* some macros we need */
-#define FT_FIXED_ONE ( (FT_Fixed)0x10000 )
-
-#define FT_fdot14ToFixed( x ) \
- ( (FT_Fixed)( (FT_ULong)(x) << 2 ) )
-#define FT_intToFixed( i ) \
- ( (FT_Fixed)( (FT_ULong)(i) << 16 ) )
-#define FT_fixedToInt( x ) \
- ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
-
-
static FT_Error
ft_var_load_item_variation_store( TT_Face face,
FT_ULong offset,
@@ -702,29 +711,30 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_load_hvvar */
- /* */
- /* <Description> */
- /* If `vertical' is zero, parse the `HVAR' table and set */
- /* `blend->hvar_loaded' to TRUE. On success, `blend->hvar_checked' */
- /* is set to TRUE. */
- /* */
- /* If `vertical' is not zero, parse the `VVAR' table and set */
- /* `blend->vvar_loaded' to TRUE. On success, `blend->vvar_checked' */
- /* is set to TRUE. */
- /* */
- /* Some memory may remain allocated on error; it is always freed in */
- /* `tt_done_blend', however. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_load_hvvar
+ *
+ * @Description:
+ * If `vertical' is zero, parse the `HVAR' table and set
+ * `blend->hvar_loaded' to TRUE. On success, `blend->hvar_checked'
+ * is set to TRUE.
+ *
+ * If `vertical' is not zero, parse the `VVAR' table and set
+ * `blend->vvar_loaded' to TRUE. On success, `blend->vvar_checked'
+ * is set to TRUE.
+ *
+ * Some memory may remain allocated on error; it is always freed in
+ * `tt_done_blend', however.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
ft_var_load_hvvar( TT_Face face,
FT_Bool vertical )
@@ -872,7 +882,7 @@
/* outer loop steps through master designs to be blended */
for ( master = 0; master < varData->regionIdxCount; master++ )
{
- FT_Fixed scalar = FT_FIXED_ONE;
+ FT_Fixed scalar = 0x10000L;
FT_UInt regionIndex = varData->regionIndices[master];
GX_AxisCoords axis = itemStore->varRegionList[regionIndex].axisList;
@@ -881,47 +891,43 @@
/* inner loop steps through axes in this region */
for ( j = 0; j < itemStore->axisCount; j++, axis++ )
{
- FT_Fixed axisScalar;
-
-
/* compute the scalar contribution of this axis; */
/* ignore invalid ranges */
if ( axis->startCoord > axis->peakCoord ||
axis->peakCoord > axis->endCoord )
- axisScalar = FT_FIXED_ONE;
+ continue;
else if ( axis->startCoord < 0 &&
axis->endCoord > 0 &&
axis->peakCoord != 0 )
- axisScalar = FT_FIXED_ONE;
+ continue;
/* peak of 0 means ignore this axis */
else if ( axis->peakCoord == 0 )
- axisScalar = FT_FIXED_ONE;
+ continue;
- /* ignore this region if coords are out of range */
- else if ( face->blend->normalizedcoords[j] < axis->startCoord ||
- face->blend->normalizedcoords[j] > axis->endCoord )
- axisScalar = 0;
+ else if ( face->blend->normalizedcoords[j] == axis->peakCoord )
+ continue;
- /* calculate a proportional factor */
- else
+ /* ignore this region if coords are out of range */
+ else if ( face->blend->normalizedcoords[j] <= axis->startCoord ||
+ face->blend->normalizedcoords[j] >= axis->endCoord )
{
- if ( face->blend->normalizedcoords[j] == axis->peakCoord )
- axisScalar = FT_FIXED_ONE;
- else if ( face->blend->normalizedcoords[j] < axis->peakCoord )
- axisScalar =
- FT_DivFix( face->blend->normalizedcoords[j] - axis->startCoord,
- axis->peakCoord - axis->startCoord );
- else
- axisScalar =
- FT_DivFix( axis->endCoord - face->blend->normalizedcoords[j],
- axis->endCoord - axis->peakCoord );
+ scalar = 0;
+ break;
}
- /* take product of all the axis scalars */
- scalar = FT_MulFix( scalar, axisScalar );
-
+ /* cumulative product of all the axis scalars */
+ else if ( face->blend->normalizedcoords[j] < axis->peakCoord )
+ scalar =
+ FT_MulDiv( scalar,
+ face->blend->normalizedcoords[j] - axis->startCoord,
+ axis->peakCoord - axis->startCoord );
+ else
+ scalar =
+ FT_MulDiv( scalar,
+ axis->endCoord - face->blend->normalizedcoords[j],
+ axis->endCoord - axis->peakCoord );
} /* per-axis loop */
/* get the scaled delta for this region */
@@ -937,25 +943,29 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_hvadvance_adjust */
- /* */
- /* <Description> */
- /* Apply `HVAR' advance width or `VVAR' advance height adjustment of */
- /* a given glyph. */
- /* */
- /* <Input> */
- /* gindex :: The glyph index. */
- /* */
- /* vertical :: If set, handle `VVAR' table. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* */
- /* adelta :: Points to width or height value that gets modified. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_hvadvance_adjust
+ *
+ * @Description:
+ * Apply `HVAR' advance width or `VVAR' advance height adjustment of
+ * a given glyph.
+ *
+ * @Input:
+ * gindex ::
+ * The glyph index.
+ *
+ * vertical ::
+ * If set, handle `VVAR' table.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ *
+ * adelta ::
+ * Points to width or height value that gets modified.
+ */
static FT_Error
tt_hvadvance_adjust( TT_Face face,
FT_UInt gindex,
@@ -1151,20 +1161,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_load_mvar */
- /* */
- /* <Description> */
- /* Parse the `MVAR' table. */
- /* */
- /* Some memory may remain allocated on error; it is always freed in */
- /* `tt_done_blend', however. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_load_mvar
+ *
+ * @Description:
+ * Parse the `MVAR' table.
+ *
+ * Some memory may remain allocated on error; it is always freed in
+ * `tt_done_blend', however.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ */
static void
ft_var_load_mvar( TT_Face face )
{
@@ -1297,22 +1308,26 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_apply_mvar */
- /* */
- /* <Description> */
- /* Apply `MVAR' table adjustments. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_apply_mvar
+ *
+ * @Description:
+ * Apply `MVAR' table adjustments.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ */
FT_LOCAL_DEF( void )
tt_apply_mvar( TT_Face face )
{
GX_Blend blend = face->blend;
GX_Value value, limit;
+ FT_Short mvar_hasc_delta = 0;
+ FT_Short mvar_hdsc_delta = 0;
+ FT_Short mvar_hlgp_delta = 0;
if ( !( face->variation_support & TT_FACE_FLAG_VAR_MVAR ) )
@@ -1347,6 +1362,14 @@
/* since we handle both signed and unsigned values as FT_Short, */
/* ensure proper overflow arithmetic */
*p = (FT_Short)( value->unmodified + (FT_Short)delta );
+
+ /* Treat hasc, hdsc and hlgp specially, see below. */
+ if ( value->tag == MVAR_TAG_HASC )
+ mvar_hasc_delta = (FT_Short)delta;
+ else if ( value->tag == MVAR_TAG_HDSC )
+ mvar_hdsc_delta = (FT_Short)delta;
+ else if ( value->tag == MVAR_TAG_HLGP )
+ mvar_hlgp_delta = (FT_Short)delta;
}
}
@@ -1354,25 +1377,40 @@
{
FT_Face root = &face->root;
-
- if ( face->os2.version != 0xFFFFU )
- {
- if ( face->os2.sTypoAscender || face->os2.sTypoDescender )
- {
- root->ascender = face->os2.sTypoAscender;
- root->descender = face->os2.sTypoDescender;
-
- root->height = root->ascender - root->descender +
- face->os2.sTypoLineGap;
- }
- else
- {
- root->ascender = (FT_Short)face->os2.usWinAscent;
- root->descender = -(FT_Short)face->os2.usWinDescent;
-
- root->height = root->ascender - root->descender;
- }
- }
+ /*
+ * Apply the deltas of hasc, hdsc and hlgp to the FT_Face's ascender,
+ * descender and height attributes, no matter how they were originally
+ * computed.
+ *
+ * (Code that ignores those and accesses the font's metrics values
+ * directly is already served by the delta application code above.)
+ *
+ * The MVAR table supports variations for both typo and win metrics.
+ * According to Behdad Esfahbod, the thinking of the working group was
+ * that no one uses win metrics anymore for setting line metrics (the
+ * specification even calls these metrics "horizontal clipping
+ * ascent/descent", probably for their role on the Windows platform in
+ * computing clipping boxes), and new fonts should use typo metrics, so
+ * typo deltas should be applied to whatever sfnt_load_face decided the
+ * line metrics should be.
+ *
+ * Before, the following led to different line metrics between default
+ * outline and instances, visible when e.g. the default outlines were
+ * used as the regular face and instances for everything else:
+ *
+ * 1. sfnt_load_face applied the hhea metrics by default.
+ * 2. This code later applied the typo metrics by default, regardless of
+ * whether they were actually changed or the font had the OS/2 table's
+ * fsSelection's bit 7 (USE_TYPO_METRICS) set.
+ */
+ FT_Short current_line_gap = root->height - root->ascender +
+ root->descender;
+
+
+ root->ascender = root->ascender + mvar_hasc_delta;
+ root->descender = root->descender + mvar_hdsc_delta;
+ root->height = root->ascender - root->descender +
+ current_line_gap + mvar_hlgp_delta;
root->underline_position = face->postscript.underlinePosition -
face->postscript.underlineThickness / 2;
@@ -1400,21 +1438,22 @@
} GX_GVar_Head;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_load_gvar */
- /* */
- /* <Description> */
- /* Parse the `gvar' table if present. If `fvar' is there, `gvar' had */
- /* better be there too. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_load_gvar
+ *
+ * @Description:
+ * Parse the `gvar' table if present. If `fvar' is there, `gvar' had
+ * better be there too.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
ft_var_load_gvar( TT_Face face )
{
@@ -1512,28 +1551,55 @@
if ( gvar_head.flags & 1 )
{
+ FT_ULong limit = gvar_start + table_len;
+
+
/* long offsets (one more offset than glyphs, to mark size of last) */
if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) )
goto Exit;
for ( i = 0; i <= blend->gv_glyphcnt; i++ )
+ {
blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG();
-
- FT_FRAME_EXIT();
+ /* use `>', not `>=' */
+ if ( blend->glyphoffsets[i] > limit )
+ {
+ FT_TRACE2(( "ft_var_load_gvar:"
+ " invalid glyph variation data offset for index %d\n",
+ i ));
+ error = FT_THROW( Invalid_Table );
+ break;
+ }
+ }
}
else
{
+ FT_ULong limit = gvar_start + table_len;
+
+
/* short offsets (one more offset than glyphs, to mark size of last) */
if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) )
goto Exit;
for ( i = 0; i <= blend->gv_glyphcnt; i++ )
+ {
blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2;
- /* XXX: Undocumented: `*2'! */
-
- FT_FRAME_EXIT();
+ /* use `>', not `>=' */
+ if ( blend->glyphoffsets[i] > limit )
+ {
+ FT_TRACE2(( "ft_var_load_gvar:"
+ " invalid glyph variation data offset for index %d\n",
+ i ));
+ error = FT_THROW( Invalid_Table );
+ break;
+ }
+ }
}
+ FT_FRAME_EXIT();
+ if ( error )
+ goto Exit;
+
if ( blend->tuplecount != 0 )
{
if ( FT_NEW_ARRAY( blend->tuplecoords,
@@ -1567,33 +1633,38 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_var_apply_tuple */
- /* */
- /* <Description> */
- /* Figure out whether a given tuple (design) applies to the current */
- /* blend, and if so, what is the scaling factor. */
- /* */
- /* <Input> */
- /* blend :: The current blend of the font. */
- /* */
- /* tupleIndex :: A flag saying whether this is an intermediate */
- /* tuple or not. */
- /* */
- /* tuple_coords :: The coordinates of the tuple in normalized axis */
- /* units. */
- /* */
- /* im_start_coords :: The initial coordinates where this tuple starts */
- /* to apply (for intermediate coordinates). */
- /* */
- /* im_end_coords :: The final coordinates after which this tuple no */
- /* longer applies (for intermediate coordinates). */
- /* */
- /* <Return> */
- /* An FT_Fixed value containing the scaling factor. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * ft_var_apply_tuple
+ *
+ * @Description:
+ * Figure out whether a given tuple (design) applies to the current
+ * blend, and if so, what is the scaling factor.
+ *
+ * @Input:
+ * blend ::
+ * The current blend of the font.
+ *
+ * tupleIndex ::
+ * A flag saying whether this is an intermediate
+ * tuple or not.
+ *
+ * tuple_coords ::
+ * The coordinates of the tuple in normalized axis
+ * units.
+ *
+ * im_start_coords ::
+ * The initial coordinates where this tuple starts
+ * to apply (for intermediate coordinates).
+ *
+ * im_end_coords ::
+ * The final coordinates after which this tuple no
+ * longer applies (for intermediate coordinates).
+ *
+ * @Return:
+ * An FT_Fixed value containing the scaling factor.
+ */
static FT_Fixed
ft_var_apply_tuple( GX_Blend blend,
FT_UShort tupleIndex,
@@ -1607,13 +1678,8 @@
for ( i = 0; i < blend->num_axis; i++ )
{
- FT_TRACE6(( " axis coordinate %d (%.5f):\n",
+ FT_TRACE6(( " axis %d coordinate %.5f:\n",
i, blend->normalizedcoords[i] / 65536.0 ));
- if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
- FT_TRACE6(( " intermediate coordinates %d (%.5f, %.5f):\n",
- i,
- im_start_coords[i] / 65536.0,
- im_end_coords[i] / 65536.0 ));
/* It's not clear why (for intermediate tuples) we don't need */
/* to check against start/end -- the documentation says we don't. */
@@ -1622,7 +1688,7 @@
if ( tuple_coords[i] == 0 )
{
- FT_TRACE6(( " tuple coordinate is zero, ignored\n", i ));
+ FT_TRACE6(( " tuple coordinate is zero, ignore\n", i ));
continue;
}
@@ -1635,7 +1701,7 @@
if ( blend->normalizedcoords[i] == tuple_coords[i] )
{
- FT_TRACE6(( " tuple coordinate value %.5f fits perfectly\n",
+ FT_TRACE6(( " tuple coordinate %.5f fits perfectly\n",
tuple_coords[i] / 65536.0 ));
/* `apply' does not change */
continue;
@@ -1648,13 +1714,13 @@
if ( blend->normalizedcoords[i] < FT_MIN( 0, tuple_coords[i] ) ||
blend->normalizedcoords[i] > FT_MAX( 0, tuple_coords[i] ) )
{
- FT_TRACE6(( " tuple coordinate value %.5f is exceeded, stop\n",
+ FT_TRACE6(( " tuple coordinate %.5f is exceeded, stop\n",
tuple_coords[i] / 65536.0 ));
apply = 0;
break;
}
- FT_TRACE6(( " tuple coordinate value %.5f fits\n",
+ FT_TRACE6(( " tuple coordinate %.5f fits\n",
tuple_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
blend->normalizedcoords[i],
@@ -1664,10 +1730,10 @@
{
/* intermediate tuple */
- if ( blend->normalizedcoords[i] < im_start_coords[i] ||
- blend->normalizedcoords[i] > im_end_coords[i] )
+ if ( blend->normalizedcoords[i] <= im_start_coords[i] ||
+ blend->normalizedcoords[i] >= im_end_coords[i] )
{
- FT_TRACE6(( " intermediate tuple range [%.5f;%.5f] is exceeded,"
+ FT_TRACE6(( " intermediate tuple range ]%.5f;%.5f[ is exceeded,"
" stop\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
@@ -1675,25 +1741,17 @@
break;
}
- else if ( blend->normalizedcoords[i] < tuple_coords[i] )
- {
- FT_TRACE6(( " intermediate tuple range [%.5f;%.5f] fits\n",
- im_start_coords[i] / 65536.0,
- im_end_coords[i] / 65536.0 ));
+ FT_TRACE6(( " intermediate tuple range ]%.5f;%.5f[ fits\n",
+ im_start_coords[i] / 65536.0,
+ im_end_coords[i] / 65536.0 ));
+ if ( blend->normalizedcoords[i] < tuple_coords[i] )
apply = FT_MulDiv( apply,
blend->normalizedcoords[i] - im_start_coords[i],
tuple_coords[i] - im_start_coords[i] );
- }
-
else
- {
- FT_TRACE6(( " intermediate tuple range [%.5f;%.5f] fits\n",
- im_start_coords[i] / 65536.0,
- im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
im_end_coords[i] - blend->normalizedcoords[i],
im_end_coords[i] - tuple_coords[i] );
- }
}
}
@@ -1756,11 +1814,11 @@
}
if ( coord < a->def )
- normalized[i] = -FT_DivFix( coord - a->def,
- a->minimum - a->def );
+ normalized[i] = -FT_DivFix( SUB_LONG( coord, a->def ),
+ SUB_LONG( a->minimum, a->def ) );
else if ( coord > a->def )
- normalized[i] = FT_DivFix( coord - a->def,
- a->maximum - a->def );
+ normalized[i] = FT_DivFix( SUB_LONG( coord, a->def ),
+ SUB_LONG( a->maximum, a->def ) );
else
normalized[i] = 0;
}
@@ -1910,27 +1968,29 @@
} GX_FVar_Axis;
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Get_MM_Var */
- /* */
- /* <Description> */
- /* Check that the font's `fvar' table is valid, parse it, and return */
- /* those data. It also loads (and parses) the `MVAR' table, if */
- /* possible. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* TT_Get_MM_Var initializes the blend structure. */
- /* */
- /* <Output> */
- /* master :: The `fvar' data (must be freed by caller). Can be NULL, */
- /* which makes this function simply load MM support. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Get_MM_Var
+ *
+ * @Description:
+ * Check that the font's `fvar' table is valid, parse it, and return
+ * those data. It also loads (and parses) the `MVAR' table, if
+ * possible.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ * TT_Get_MM_Var initializes the blend structure.
+ *
+ * @Output:
+ * master ::
+ * The `fvar' data (must be freed by caller). Can be NULL,
+ * which makes this function simply load MM support.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Get_MM_Var( TT_Face face,
FT_MM_Var* *master )
@@ -2507,11 +2567,14 @@
if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) )
{
- FT_UInt idx = (FT_UInt)face->root.face_index >> 16;
+ FT_UInt instance_index = (FT_UInt)face->root.face_index >> 16;
c = blend->normalizedcoords + i;
- n = blend->normalized_stylecoords + idx * mmvar->num_axis + i;
+ n = blend->normalized_stylecoords +
+ ( instance_index - 1 ) * mmvar->num_axis +
+ i;
+
for ( j = i; j < mmvar->num_axis; j++, n++, c++ )
if ( *c != *n )
have_diff = 1;
@@ -2526,7 +2589,11 @@
/* return value -1 indicates `no change' */
if ( !have_diff )
+ {
+ face->doblend = TRUE;
+
return -1;
+ }
for ( ; i < mmvar->num_axis; i++ )
{
@@ -2590,31 +2657,34 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Set_MM_Blend */
- /* */
- /* <Description> */
- /* Set the blend (normalized) coordinates for this instance of the */
- /* font. Check that the `gvar' table is reasonable and does some */
- /* initial preparation. */
- /* */
- /* <InOut> */
- /* face :: The font. */
- /* Initialize the blend structure with `gvar' data. */
- /* */
- /* <Input> */
- /* num_coords :: The number of available coordinates. If it is */
- /* larger than the number of axes, ignore the excess */
- /* values. If it is smaller than the number of axes, */
- /* use the default value (0) for the remaining axes. */
- /* */
- /* coords :: An array of `num_coords', each between [-1,1]. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Set_MM_Blend
+ *
+ * @Description:
+ * Set the blend (normalized) coordinates for this instance of the
+ * font. Check that the `gvar' table is reasonable and does some
+ * initial preparation.
+ *
+ * @InOut:
+ * face ::
+ * The font.
+ * Initialize the blend structure with `gvar' data.
+ *
+ * @Input:
+ * num_coords ::
+ * The number of available coordinates. If it is
+ * larger than the number of axes, ignore the excess
+ * values. If it is smaller than the number of axes,
+ * use the default value (0) for the remaining axes.
+ *
+ * coords ::
+ * An array of `num_coords', each between [-1,1].
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Set_MM_Blend( TT_Face face,
FT_UInt num_coords,
@@ -2636,29 +2706,32 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Get_MM_Blend */
- /* */
- /* <Description> */
- /* Get the blend (normalized) coordinates for this instance of the */
- /* font. */
- /* */
- /* <InOut> */
- /* face :: The font. */
- /* Initialize the blend structure with `gvar' data. */
- /* */
- /* <Input> */
- /* num_coords :: The number of available coordinates. If it is */
- /* larger than the number of axes, set the excess */
- /* values to 0. */
- /* */
- /* coords :: An array of `num_coords', each between [-1,1]. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Get_MM_Blend
+ *
+ * @Description:
+ * Get the blend (normalized) coordinates for this instance of the
+ * font.
+ *
+ * @InOut:
+ * face ::
+ * The font.
+ * Initialize the blend structure with `gvar' data.
+ *
+ * @Input:
+ * num_coords ::
+ * The number of available coordinates. If it is
+ * larger than the number of axes, set the excess
+ * values to 0.
+ *
+ * coords ::
+ * An array of `num_coords', each between [-1,1].
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Get_MM_Blend( TT_Face face,
FT_UInt num_coords,
@@ -2712,31 +2785,34 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Set_Var_Design */
- /* */
- /* <Description> */
- /* Set the coordinates for the instance, measured in the user */
- /* coordinate system. Parse the `avar' table (if present) to convert */
- /* from user to normalized coordinates. */
- /* */
- /* <InOut> */
- /* face :: The font face. */
- /* Initialize the blend struct with `gvar' data. */
- /* */
- /* <Input> */
- /* num_coords :: The number of available coordinates. If it is */
- /* larger than the number of axes, ignore the excess */
- /* values. If it is smaller than the number of axes, */
- /* use the default values for the remaining axes. */
- /* */
- /* coords :: A coordinate array with `num_coords' elements. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Set_Var_Design
+ *
+ * @Description:
+ * Set the coordinates for the instance, measured in the user
+ * coordinate system. Parse the `avar' table (if present) to convert
+ * from user to normalized coordinates.
+ *
+ * @InOut:
+ * face ::
+ * The font face.
+ * Initialize the blend struct with `gvar' data.
+ *
+ * @Input:
+ * num_coords ::
+ * The number of available coordinates. If it is
+ * larger than the number of axes, ignore the excess
+ * values. If it is smaller than the number of axes,
+ * use the default values for the remaining axes.
+ *
+ * coords ::
+ * A coordinate array with `num_coords' elements.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Set_Var_Design( TT_Face face,
FT_UInt num_coords,
@@ -2854,28 +2930,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Get_Var_Design */
- /* */
- /* <Description> */
- /* Get the design coordinates of the currently selected interpolated */
- /* font. */
- /* */
- /* <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. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Get_Var_Design
+ *
+ * @Description:
+ * Get the design coordinates of the currently selected interpolated
+ * font.
+ *
+ * @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.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Get_Var_Design( TT_Face face,
FT_UInt num_coords,
@@ -2929,24 +3008,26 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Set_Named_Instance */
- /* */
- /* <Description> */
- /* Set the given named instance, also resetting any further */
- /* variation. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* instance_index :: The instance index, starting with value 1. */
- /* Value 0 indicates to not use an instance. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Set_Named_Instance
+ *
+ * @Description:
+ * Set the given named instance, also resetting any further
+ * variation.
+ *
+ * @Input:
+ * face ::
+ * A handle to the source face.
+ *
+ * instance_index ::
+ * The instance index, starting with value 1.
+ * Value 0 indicates to not use an instance.
+ *
+ * @Return:
+ * FreeType error code. 0~means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Set_Named_Instance( TT_Face face,
FT_UInt instance_index )
@@ -3022,48 +3103,60 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_vary_cvt */
- /* */
- /* <Description> */
- /* Modify the loaded cvt table according to the `cvar' table and the */
- /* font's blend. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* Most errors are ignored. It is perfectly valid not to have a */
- /* `cvar' table even if there is a `gvar' and `fvar' table. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_vary_cvt
+ *
+ * @Description:
+ * Modify the loaded cvt table according to the `cvar' table and the
+ * font's blend.
+ *
+ * @InOut:
+ * face ::
+ * A handle to the target face object.
+ *
+ * @Input:
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * Most errors are ignored. It is perfectly valid not to have a
+ * `cvar' table even if there is a `gvar' and `fvar' table.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_vary_cvt( TT_Face face,
FT_Stream stream )
{
- FT_Error error;
- FT_Memory memory = stream->memory;
- FT_ULong table_start;
- FT_ULong table_len;
- FT_UInt tupleCount;
- FT_ULong offsetToData;
- FT_ULong here;
- FT_UInt i, j;
- FT_Fixed* tuple_coords = NULL;
- FT_Fixed* im_start_coords = NULL;
- FT_Fixed* im_end_coords = NULL;
- GX_Blend blend = face->blend;
- FT_UInt point_count, spoint_count = 0;
+ FT_Error error;
+ FT_Memory memory = stream->memory;
+
+ FT_ULong table_start;
+ FT_ULong table_len;
+
+ FT_UInt tupleCount;
+ FT_ULong offsetToData;
+
+ FT_ULong here;
+ FT_UInt i, j;
+
+ FT_Fixed* tuple_coords = NULL;
+ FT_Fixed* im_start_coords = NULL;
+ FT_Fixed* im_end_coords = NULL;
+
+ GX_Blend blend = face->blend;
+
+ FT_UInt point_count;
+ FT_UInt spoint_count = 0;
+
FT_UShort* sharedpoints = NULL;
FT_UShort* localpoints = NULL;
FT_UShort* points;
- FT_Short* deltas;
+
+ FT_Fixed* deltas = NULL;
+ FT_Fixed* cvt_deltas = NULL;
FT_TRACE2(( "CVAR " ));
@@ -3146,11 +3239,14 @@
}
FT_TRACE5(( "cvar: there %s %d tuple%s:\n",
- ( tupleCount & 0xFFF ) == 1 ? "is" : "are",
- tupleCount & 0xFFF,
- ( tupleCount & 0xFFF ) == 1 ? "" : "s" ));
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
+ tupleCount & GX_TC_TUPLE_COUNT_MASK,
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
+
+ if ( FT_NEW_ARRAY( cvt_deltas, face->cvt_size ) )
+ goto FExit;
- for ( i = 0; i < ( tupleCount & 0xFFF ); i++ )
+ for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
{
FT_UInt tupleDataSize;
FT_UInt tupleIndex;
@@ -3174,13 +3270,25 @@
" invalid tuple index\n" ));
error = FT_THROW( Invalid_Table );
- goto Exit;
+ goto FExit;
}
else
+ {
+ if ( !blend->tuplecoords )
+ {
+ FT_TRACE2(( "tt_face_vary_cvt:"
+ " no valid tuple coordinates available\n" ));
+
+ error = FT_THROW( Invalid_Table );
+ goto FExit;
+ }
+
FT_MEM_COPY(
tuple_coords,
- &blend->tuplecoords[( tupleIndex & 0xFFF ) * blend->num_axis],
+ blend->tuplecoords +
+ ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis,
blend->num_axis * sizeof ( FT_Fixed ) );
+ }
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
@@ -3241,17 +3349,21 @@
/* this means that there are deltas for every entry in cvt */
for ( j = 0; j < face->cvt_size; j++ )
{
- FT_Long orig_cvt = face->cvt[j];
+ FT_Fixed old_cvt_delta;
- face->cvt[j] = (FT_Short)( orig_cvt +
- FT_MulFix( deltas[j], apply ) );
+ old_cvt_delta = cvt_deltas[j];
+ cvt_deltas[j] = old_cvt_delta + FT_MulFix( deltas[j], apply );
#ifdef FT_DEBUG_LEVEL_TRACE
- if ( orig_cvt != face->cvt[j] )
+ if ( old_cvt_delta != cvt_deltas[j] )
{
- FT_TRACE7(( " %d: %d -> %d\n",
- j, orig_cvt, face->cvt[j] ));
+ FT_TRACE7(( " %d: %f -> %f\n",
+ j,
+ ( FT_intToFixed( face->cvt[j] ) +
+ old_cvt_delta ) / 65536.0,
+ ( FT_intToFixed( face->cvt[j] ) +
+ cvt_deltas[j] ) / 65536.0 ));
count++;
}
#endif
@@ -3274,23 +3386,26 @@
for ( j = 0; j < point_count; j++ )
{
- int pindex;
- FT_Long orig_cvt;
+ int pindex;
+ FT_Fixed old_cvt_delta;
pindex = points[j];
if ( (FT_ULong)pindex >= face->cvt_size )
continue;
- orig_cvt = face->cvt[pindex];
- face->cvt[pindex] = (FT_Short)( orig_cvt +
- FT_MulFix( deltas[j], apply ) );
+ old_cvt_delta = cvt_deltas[pindex];
+ cvt_deltas[pindex] = old_cvt_delta + FT_MulFix( deltas[j], apply );
#ifdef FT_DEBUG_LEVEL_TRACE
- if ( orig_cvt != face->cvt[pindex] )
+ if ( old_cvt_delta != cvt_deltas[pindex] )
{
- FT_TRACE7(( " %d: %d -> %d\n",
- pindex, orig_cvt, face->cvt[pindex] ));
+ FT_TRACE7(( " %d: %f -> %f\n",
+ pindex,
+ ( FT_intToFixed( face->cvt[pindex] ) +
+ old_cvt_delta ) / 65536.0,
+ ( FT_intToFixed( face->cvt[pindex] ) +
+ cvt_deltas[pindex] ) / 65536.0 ));
count++;
}
#endif
@@ -3313,6 +3428,9 @@
FT_TRACE5(( "\n" ));
+ for ( i = 0; i < face->cvt_size; i++ )
+ face->cvt[i] += FT_fixedToInt( cvt_deltas[i] );
+
FExit:
FT_FRAME_EXIT();
@@ -3322,6 +3440,7 @@
FT_FREE( tuple_coords );
FT_FREE( im_start_coords );
FT_FREE( im_end_coords );
+ FT_FREE( cvt_deltas );
return error;
}
@@ -3367,9 +3486,8 @@
/* between `p1' and `p2', using `ref1' and `ref2' as the reference */
/* point indices. */
- /* modeled after `af_iup_interp', `_iup_worker_interpolate', and */
- /* `Ins_IUP' */
-
+ /* modeled after `af_iup_interp', `_iup_worker_interpolate', and */
+ /* `Ins_IUP' with spec differences in handling ill-defined cases. */
static void
tt_delta_interpolate( int p1,
int p2,
@@ -3528,56 +3646,72 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Vary_Apply_Glyph_Deltas */
- /* */
- /* <Description> */
- /* Apply the appropriate deltas to the current glyph. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* glyph_index :: The index of the glyph being modified. */
- /* */
- /* n_points :: The number of the points in the glyph, including */
- /* phantom points. */
- /* */
- /* <InOut> */
- /* outline :: The outline to change. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Vary_Apply_Glyph_Deltas
+ *
+ * @Description:
+ * Apply the appropriate deltas to the current glyph.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * glyph_index ::
+ * The index of the glyph being modified.
+ *
+ * n_points ::
+ * The number of the points in the glyph, including
+ * phantom points.
+ *
+ * @InOut:
+ * outline ::
+ * The outline to change.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Vary_Apply_Glyph_Deltas( TT_Face face,
FT_UInt glyph_index,
FT_Outline* outline,
FT_UInt n_points )
{
- FT_Stream stream = face->root.stream;
- FT_Memory memory = stream->memory;
- GX_Blend blend = face->blend;
+ FT_Error error;
+ FT_Stream stream = face->root.stream;
+ FT_Memory memory = stream->memory;
- FT_Vector* points_org = NULL;
- FT_Vector* points_out = NULL;
+ FT_Vector* points_org = NULL; /* coordinates in 16.16 format */
+ FT_Vector* points_out = NULL; /* coordinates in 16.16 format */
FT_Bool* has_delta = NULL;
- FT_Error error;
- FT_ULong glyph_start;
- FT_UInt tupleCount;
- FT_ULong offsetToData;
- FT_ULong here;
- FT_UInt i, j;
- FT_Fixed* tuple_coords = NULL;
- FT_Fixed* im_start_coords = NULL;
- FT_Fixed* im_end_coords = NULL;
- FT_UInt point_count, spoint_count = 0;
+ FT_ULong glyph_start;
+
+ FT_UInt tupleCount;
+ FT_ULong offsetToData;
+ FT_ULong dataSize;
+
+ FT_ULong here;
+ FT_UInt i, j;
+
+ FT_Fixed* tuple_coords = NULL;
+ FT_Fixed* im_start_coords = NULL;
+ FT_Fixed* im_end_coords = NULL;
+
+ GX_Blend blend = face->blend;
+
+ FT_UInt point_count;
+ FT_UInt spoint_count = 0;
+
FT_UShort* sharedpoints = NULL;
FT_UShort* localpoints = NULL;
FT_UShort* points;
- FT_Short *deltas_x, *deltas_y;
+
+ FT_Fixed* deltas_x = NULL;
+ FT_Fixed* deltas_y = NULL;
+ FT_Fixed* point_deltas_x = NULL;
+ FT_Fixed* point_deltas_y = NULL;
if ( !face->doblend || !blend )
@@ -3597,9 +3731,11 @@
FT_NEW_ARRAY( has_delta, n_points ) )
goto Fail1;
- if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) ||
- FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] -
- blend->glyphoffsets[glyph_index] ) )
+ dataSize = blend->glyphoffsets[glyph_index + 1] -
+ blend->glyphoffsets[glyph_index];
+
+ if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) ||
+ FT_FRAME_ENTER( dataSize ) )
goto Fail1;
glyph_start = FT_Stream_FTell( stream );
@@ -3615,8 +3751,8 @@
offsetToData = FT_GET_USHORT();
/* rough sanity test */
- if ( offsetToData + ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 >
- blend->gvar_size )
+ if ( offsetToData > dataSize ||
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 > dataSize )
{
FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
" invalid glyph variation array header\n" ));
@@ -3646,8 +3782,15 @@
tupleCount & GX_TC_TUPLE_COUNT_MASK,
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
+ if ( FT_NEW_ARRAY( point_deltas_x, n_points ) ||
+ FT_NEW_ARRAY( point_deltas_y, n_points ) )
+ goto Fail3;
+
for ( j = 0; j < n_points; j++ )
- points_org[j] = outline->points[j];
+ {
+ points_org[j].x = FT_intToFixed( outline->points[j].x );
+ points_org[j].y = FT_intToFixed( outline->points[j].y );
+ }
for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
{
@@ -3673,12 +3816,13 @@
" invalid tuple index\n" ));
error = FT_THROW( Invalid_Table );
- goto Fail2;
+ goto Fail3;
}
else
FT_MEM_COPY(
tuple_coords,
- &blend->tuplecoords[( tupleIndex & 0xFFF ) * blend->num_axis],
+ blend->tuplecoords +
+ ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis,
blend->num_axis * sizeof ( FT_Fixed ) );
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
@@ -3742,14 +3886,17 @@
/* this means that there are deltas for every point in the glyph */
for ( j = 0; j < n_points; j++ )
{
- FT_Pos delta_x = FT_MulFix( deltas_x[j], apply );
- FT_Pos delta_y = FT_MulFix( deltas_y[j], apply );
+ FT_Fixed old_point_delta_x = point_deltas_x[j];
+ FT_Fixed old_point_delta_y = point_deltas_y[j];
+
+ FT_Fixed point_delta_x = FT_MulFix( deltas_x[j], apply );
+ FT_Fixed point_delta_y = FT_MulFix( deltas_y[j], apply );
if ( j < n_points - 4 )
{
- outline->points[j].x += delta_x;
- outline->points[j].y += delta_y;
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
}
else
{
@@ -3759,33 +3906,37 @@
if ( j == ( n_points - 4 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_LSB ) )
- outline->points[j].x += delta_x;
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
else if ( j == ( n_points - 3 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_HADVANCE ) )
- outline->points[j].x += delta_x;
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
else if ( j == ( n_points - 2 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_TSB ) )
- outline->points[j].y += delta_y;
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
else if ( j == ( n_points - 1 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_VADVANCE ) )
- outline->points[j].y += delta_y;
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
}
#ifdef FT_DEBUG_LEVEL_TRACE
- if ( delta_x || delta_y )
+ if ( point_delta_x || point_delta_y )
{
- FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n",
+ FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n",
j,
- outline->points[j].x - delta_x,
- outline->points[j].y - delta_y,
- outline->points[j].x,
- outline->points[j].y ));
+ ( FT_intToFixed( outline->points[j].x ) +
+ old_point_delta_x ) / 65536.0,
+ ( FT_intToFixed( outline->points[j].y ) +
+ old_point_delta_y ) / 65536.0,
+ ( FT_intToFixed( outline->points[j].x ) +
+ point_deltas_x[j] ) / 65536.0,
+ ( FT_intToFixed( outline->points[j].y ) +
+ point_deltas_y[j] ) / 65536.0 ));
count++;
}
#endif
@@ -3837,14 +3988,17 @@
for ( j = 0; j < n_points; j++ )
{
- FT_Pos delta_x = points_out[j].x - points_org[j].x;
- FT_Pos delta_y = points_out[j].y - points_org[j].y;
+ FT_Fixed old_point_delta_x = point_deltas_x[j];
+ FT_Fixed old_point_delta_y = point_deltas_y[j];
+
+ FT_Pos point_delta_x = points_out[j].x - points_org[j].x;
+ FT_Pos point_delta_y = points_out[j].y - points_org[j].y;
if ( j < n_points - 4 )
{
- outline->points[j].x += delta_x;
- outline->points[j].y += delta_y;
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
}
else
{
@@ -3854,33 +4008,37 @@
if ( j == ( n_points - 4 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_LSB ) )
- outline->points[j].x += delta_x;
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
else if ( j == ( n_points - 3 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_HADVANCE ) )
- outline->points[j].x += delta_x;
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
else if ( j == ( n_points - 2 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_TSB ) )
- outline->points[j].y += delta_y;
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
else if ( j == ( n_points - 1 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_VADVANCE ) )
- outline->points[j].y += delta_y;
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
}
#ifdef FT_DEBUG_LEVEL_TRACE
- if ( delta_x || delta_y )
+ if ( point_delta_x || point_delta_y )
{
- FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n",
+ FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n",
j,
- outline->points[j].x - delta_x,
- outline->points[j].y - delta_y,
- outline->points[j].x,
- outline->points[j].y ));
+ ( FT_intToFixed( outline->points[j].x ) +
+ old_point_delta_x ) / 65536.0,
+ ( FT_intToFixed( outline->points[j].y ) +
+ old_point_delta_y ) / 65536.0,
+ ( FT_intToFixed( outline->points[j].x ) +
+ point_deltas_x[j] ) / 65536.0,
+ ( FT_intToFixed( outline->points[j].y ) +
+ point_deltas_y[j] ) / 65536.0 ));
count++;
}
#endif
@@ -3904,6 +4062,16 @@
FT_TRACE5(( "\n" ));
+ for ( i = 0; i < n_points; i++ )
+ {
+ outline->points[i].x += FT_fixedToInt( point_deltas_x[i] );
+ outline->points[i].y += FT_fixedToInt( point_deltas_y[i] );
+ }
+
+ Fail3:
+ FT_FREE( point_deltas_x );
+ FT_FREE( point_deltas_y );
+
Fail2:
if ( sharedpoints != ALL_POINTS )
FT_FREE( sharedpoints );
@@ -3922,16 +4090,16 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_get_var_blend */
- /* */
- /* <Description> */
- /* An extended internal version of `TT_Get_MM_Blend' that returns */
- /* pointers instead of copying data, without any initialization of */
- /* the MM machinery in case it isn't loaded yet. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_get_var_blend
+ *
+ * @Description:
+ * An extended internal version of `TT_Get_MM_Blend' that returns
+ * pointers instead of copying data, without any initialization of
+ * the MM machinery in case it isn't loaded yet.
+ */
FT_LOCAL_DEF( FT_Error )
tt_get_var_blend( TT_Face face,
FT_UInt *num_coords,
@@ -3993,14 +4161,14 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_done_blend */
- /* */
- /* <Description> */
- /* Free the blend internal data structure. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_done_blend
+ *
+ * @Description:
+ * Free the blend internal data structure.
+ */
FT_LOCAL_DEF( void )
tt_done_blend( TT_Face face )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.h
index a37bb90266c..7e8d9768a76 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttgxvar.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttgxvar.h */
-/* */
-/* TrueType GX Font Variation loader (specification) */
-/* */
-/* Copyright 2004-2018 by */
-/* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttgxvar.h
+ *
+ * TrueType GX Font Variation loader (specification)
+ *
+ * Copyright (C) 2004-2019 by
+ * David Turner, Robert Wilhelm, Werner Lemberg and George Williams.
+ *
+ * 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 TTGXVAR_H_
@@ -29,15 +29,15 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* GX_AVarCorrespondenceRec */
- /* */
- /* <Description> */
- /* A data structure representing `shortFracCorrespondence' in `avar' */
- /* table according to the specifications from Apple. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * GX_AVarCorrespondenceRec
+ *
+ * @Description:
+ * A data structure representing `shortFracCorrespondence' in `avar'
+ * table according to the specifications from Apple.
+ */
typedef struct GX_AVarCorrespondenceRec_
{
FT_Fixed fromCoord;
@@ -46,15 +46,15 @@ FT_BEGIN_HEADER
} GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* GX_AVarRec */
- /* */
- /* <Description> */
- /* Data from the segment field of `avar' table. */
- /* There is one of these for each axis. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * GX_AVarRec
+ *
+ * @Description:
+ * Data from the segment field of `avar' table.
+ * There is one of these for each axis.
+ */
typedef struct GX_AVarSegmentRec_
{
FT_UShort pairCount;
@@ -114,14 +114,14 @@ FT_BEGIN_HEADER
} GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* GX_HVVarTableRec */
- /* */
- /* <Description> */
- /* Data from either the `HVAR' or `VVAR' table. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * GX_HVVarTableRec
+ *
+ * @Description:
+ * Data from either the `HVAR' or `VVAR' table.
+ */
typedef struct GX_HVVarTableRec_
{
GX_ItemVarStoreRec itemStore; /* Item Variation Store */
@@ -191,14 +191,14 @@ FT_BEGIN_HEADER
} GX_ValueRec, *GX_Value;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* GX_MVarTableRec */
- /* */
- /* <Description> */
- /* Data from the `MVAR' table. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * GX_MVarTableRec
+ *
+ * @Description:
+ * Data from the `MVAR' table.
+ */
typedef struct GX_MVarTableRec_
{
FT_UShort valueCount;
@@ -209,95 +209,95 @@ FT_BEGIN_HEADER
} GX_MVarTableRec, *GX_MVarTable;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* GX_BlendRec */
- /* */
- /* <Description> */
- /* Data for interpolating a font from a distortable font specified */
- /* by the GX *var tables ([fgcahvm]var). */
- /* */
- /* <Fields> */
- /* num_axis :: */
- /* The number of axes along which interpolation may happen. */
- /* */
- /* coords :: */
- /* An array of design coordinates (in user space) indicating the */
- /* contribution along each axis to the final interpolated font. */
- /* `normalizedcoords' holds the same values. */
- /* */
- /* normalizedcoords :: */
- /* An array of normalized values (between [-1,1]) indicating the */
- /* contribution along each axis to the final interpolated font. */
- /* `coords' holds the same values. */
- /* */
- /* mmvar :: */
- /* Data from the `fvar' table. */
- /* */
- /* mmvar_len :: */
- /* The length of the `mmvar' structure. */
- /* */
- /* normalized_stylecoords :: */
- /* A two-dimensional array that holds the named instance data from */
- /* `mmvar' as normalized values. */
- /* */
- /* avar_loaded :: */
- /* A Boolean; if set, FreeType tried to load (and parse) the `avar' */
- /* table. */
- /* */
- /* avar_segment :: */
- /* Data from the `avar' table. */
- /* */
- /* hvar_loaded :: */
- /* A Boolean; if set, FreeType tried to load (and parse) the `hvar' */
- /* table. */
- /* */
- /* hvar_checked :: */
- /* A Boolean; if set, FreeType successfully loaded and parsed the */
- /* `hvar' table. */
- /* */
- /* hvar_error :: */
- /* If loading and parsing of the `hvar' table failed, this field */
- /* holds the corresponding error code. */
- /* */
- /* hvar_table :: */
- /* Data from the `hvar' table. */
- /* */
- /* vvar_loaded :: */
- /* A Boolean; if set, FreeType tried to load (and parse) the `vvar' */
- /* table. */
- /* */
- /* vvar_checked :: */
- /* A Boolean; if set, FreeType successfully loaded and parsed the */
- /* `vvar' table. */
- /* */
- /* vvar_error :: */
- /* If loading and parsing of the `vvar' table failed, this field */
- /* holds the corresponding error code. */
- /* */
- /* vvar_table :: */
- /* Data from the `vvar' table. */
- /* */
- /* mvar_table :: */
- /* Data from the `mvar' table. */
- /* */
- /* tuplecount :: */
- /* The number of shared tuples in the `gvar' table. */
- /* */
- /* tuplecoords :: */
- /* A two-dimensional array that holds the shared tuple coordinates */
- /* in the `gvar' table. */
- /* */
- /* gv_glyphcnt :: */
- /* The number of glyphs handled in the `gvar' table. */
- /* */
- /* glyphoffsets :: */
- /* Offsets into the glyph variation data array. */
- /* */
- /* gvar_size :: */
- /* The size of the `gvar' table. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * GX_BlendRec
+ *
+ * @Description:
+ * Data for interpolating a font from a distortable font specified
+ * by the GX *var tables ([fgcahvm]var).
+ *
+ * @Fields:
+ * num_axis ::
+ * The number of axes along which interpolation may happen.
+ *
+ * coords ::
+ * An array of design coordinates (in user space) indicating the
+ * contribution along each axis to the final interpolated font.
+ * `normalizedcoords' holds the same values.
+ *
+ * normalizedcoords ::
+ * An array of normalized values (between [-1,1]) indicating the
+ * contribution along each axis to the final interpolated font.
+ * `coords' holds the same values.
+ *
+ * mmvar ::
+ * Data from the `fvar' table.
+ *
+ * mmvar_len ::
+ * The length of the `mmvar' structure.
+ *
+ * normalized_stylecoords ::
+ * A two-dimensional array that holds the named instance data from
+ * `mmvar' as normalized values.
+ *
+ * avar_loaded ::
+ * A Boolean; if set, FreeType tried to load (and parse) the `avar'
+ * table.
+ *
+ * avar_segment ::
+ * Data from the `avar' table.
+ *
+ * hvar_loaded ::
+ * A Boolean; if set, FreeType tried to load (and parse) the `hvar'
+ * table.
+ *
+ * hvar_checked ::
+ * A Boolean; if set, FreeType successfully loaded and parsed the
+ * `hvar' table.
+ *
+ * hvar_error ::
+ * If loading and parsing of the `hvar' table failed, this field
+ * holds the corresponding error code.
+ *
+ * hvar_table ::
+ * Data from the `hvar' table.
+ *
+ * vvar_loaded ::
+ * A Boolean; if set, FreeType tried to load (and parse) the `vvar'
+ * table.
+ *
+ * vvar_checked ::
+ * A Boolean; if set, FreeType successfully loaded and parsed the
+ * `vvar' table.
+ *
+ * vvar_error ::
+ * If loading and parsing of the `vvar' table failed, this field
+ * holds the corresponding error code.
+ *
+ * vvar_table ::
+ * Data from the `vvar' table.
+ *
+ * mvar_table ::
+ * Data from the `mvar' table.
+ *
+ * tuplecount ::
+ * The number of shared tuples in the `gvar' table.
+ *
+ * tuplecoords ::
+ * A two-dimensional array that holds the shared tuple coordinates
+ * in the `gvar' table.
+ *
+ * gv_glyphcnt ::
+ * The number of glyphs handled in the `gvar' table.
+ *
+ * glyphoffsets ::
+ * Offsets into the glyph variation data array.
+ *
+ * gvar_size ::
+ * The size of the `gvar' table.
+ */
typedef struct GX_BlendRec_
{
FT_UInt num_axis;
@@ -336,14 +336,14 @@ FT_BEGIN_HEADER
} GX_BlendRec;
- /*************************************************************************/
- /* */
- /* <enum> */
- /* GX_TupleCountFlags */
- /* */
- /* <Description> */
- /* Flags used within the `TupleCount' field of the `gvar' table. */
- /* */
+ /**************************************************************************
+ *
+ * @enum:
+ * GX_TupleCountFlags
+ *
+ * @Description:
+ * Flags used within the `TupleCount' field of the `gvar' table.
+ */
typedef enum GX_TupleCountFlags_
{
GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000,
@@ -353,15 +353,15 @@ FT_BEGIN_HEADER
} GX_TupleCountFlags;
- /*************************************************************************/
- /* */
- /* <enum> */
- /* GX_TupleIndexFlags */
- /* */
- /* <Description> */
- /* Flags used within the `TupleIndex' field of the `gvar' and `cvar' */
- /* tables. */
- /* */
+ /**************************************************************************
+ *
+ * @enum:
+ * GX_TupleIndexFlags
+ *
+ * @Description:
+ * Flags used within the `TupleIndex' field of the `gvar' and `cvar'
+ * tables.
+ */
typedef enum GX_TupleIndexFlags_
{
GX_TI_EMBEDDED_TUPLE_COORD = 0x8000,
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c
index da9b595aba0..403f3753c7b 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttinterp.c */
-/* */
-/* TrueType bytecode interpreter (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttinterp.c
+ *
+ * TrueType bytecode interpreter (body).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
/* Greg Hitchcock from Microsoft has helped a lot in resolving unclear */
@@ -39,14 +39,14 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttinterp
+#define FT_COMPONENT ttinterp
#define NO_SUBPIXEL_HINTING \
@@ -82,10 +82,10 @@
exc->func_dualproj( exc, (v)->x, (v)->y )
- /*************************************************************************/
- /* */
- /* Two simple bounds-checking macros. */
- /* */
+ /**************************************************************************
+ *
+ * Two simple bounds-checking macros.
+ */
#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) )
#define BOUNDSL( x, n ) ( (FT_ULong)(x) >= (FT_ULong)(n) )
@@ -97,30 +97,33 @@
#define FAILURE 1
- /*************************************************************************/
- /* */
- /* CODERANGE FUNCTIONS */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Goto_CodeRange */
- /* */
- /* <Description> */
- /* Switches to a new code range (updates the code related elements in */
- /* `exec', and `IP'). */
- /* */
- /* <Input> */
- /* range :: The new execution code range. */
- /* */
- /* IP :: The new IP in the new code range. */
- /* */
- /* <InOut> */
- /* exec :: The target execution context. */
- /* */
+ /**************************************************************************
+ *
+ * CODERANGE FUNCTIONS
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Goto_CodeRange
+ *
+ * @Description:
+ * Switches to a new code range (updates the code related elements in
+ * `exec', and `IP').
+ *
+ * @Input:
+ * range ::
+ * The new execution code range.
+ *
+ * IP ::
+ * The new IP in the new code range.
+ *
+ * @InOut:
+ * exec ::
+ * The target execution context.
+ */
FT_LOCAL_DEF( void )
TT_Goto_CodeRange( TT_ExecContext exec,
FT_Int range,
@@ -148,24 +151,28 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Set_CodeRange */
- /* */
- /* <Description> */
- /* Sets a code range. */
- /* */
- /* <Input> */
- /* range :: The code range index. */
- /* */
- /* base :: The new code base. */
- /* */
- /* length :: The range size in bytes. */
- /* */
- /* <InOut> */
- /* exec :: The target execution context. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Set_CodeRange
+ *
+ * @Description:
+ * Sets a code range.
+ *
+ * @Input:
+ * range ::
+ * The code range index.
+ *
+ * base ::
+ * The new code base.
+ *
+ * length ::
+ * The range size in bytes.
+ *
+ * @InOut:
+ * exec ::
+ * The target execution context.
+ */
FT_LOCAL_DEF( void )
TT_Set_CodeRange( TT_ExecContext exec,
FT_Int range,
@@ -179,20 +186,22 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Clear_CodeRange */
- /* */
- /* <Description> */
- /* Clears a code range. */
- /* */
- /* <Input> */
- /* range :: The code range index. */
- /* */
- /* <InOut> */
- /* exec :: The target execution context. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Clear_CodeRange
+ *
+ * @Description:
+ * Clears a code range.
+ *
+ * @Input:
+ * range ::
+ * The code range index.
+ *
+ * @InOut:
+ * exec ::
+ * The target execution context.
+ */
FT_LOCAL_DEF( void )
TT_Clear_CodeRange( TT_ExecContext exec,
FT_Int range )
@@ -204,29 +213,31 @@
}
- /*************************************************************************/
- /* */
- /* EXECUTION CONTEXT ROUTINES */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Done_Context */
- /* */
- /* <Description> */
- /* Destroys a given context. */
- /* */
- /* <Input> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* memory :: A handle to the parent memory object. */
- /* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* */
+ /**************************************************************************
+ *
+ * EXECUTION CONTEXT ROUTINES
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Done_Context
+ *
+ * @Description:
+ * Destroys a given context.
+ *
+ * @Input:
+ * exec ::
+ * A handle to the target execution context.
+ *
+ * memory ::
+ * A handle to the parent memory object.
+ *
+ * @Note:
+ * Only the glyph loader and debugger should call this function.
+ */
FT_LOCAL_DEF( void )
TT_Done_Context( TT_ExecContext exec )
{
@@ -257,23 +268,25 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Init_Context */
- /* */
- /* <Description> */
- /* Initializes a context object. */
- /* */
- /* <Input> */
- /* memory :: A handle to the parent memory object. */
- /* */
- /* <InOut> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Init_Context
+ *
+ * @Description:
+ * Initializes a context object.
+ *
+ * @Input:
+ * memory ::
+ * A handle to the parent memory object.
+ *
+ * @InOut:
+ * exec ::
+ * A handle to the target execution context.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
static FT_Error
Init_Context( TT_ExecContext exec,
FT_Memory memory )
@@ -313,30 +326,35 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Update_Max */
- /* */
- /* <Description> */
- /* Checks the size of a buffer and reallocates it if necessary. */
- /* */
- /* <Input> */
- /* memory :: A handle to the parent memory object. */
- /* */
- /* multiplier :: The size in bytes of each element in the buffer. */
- /* */
- /* new_max :: The new capacity (size) of the buffer. */
- /* */
- /* <InOut> */
- /* size :: The address of the buffer's current size expressed */
- /* in elements. */
- /* */
- /* buff :: The address of the buffer base pointer. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Update_Max
+ *
+ * @Description:
+ * Checks the size of a buffer and reallocates it if necessary.
+ *
+ * @Input:
+ * memory ::
+ * A handle to the parent memory object.
+ *
+ * multiplier ::
+ * The size in bytes of each element in the buffer.
+ *
+ * new_max ::
+ * The new capacity (size) of the buffer.
+ *
+ * @InOut:
+ * size ::
+ * The address of the buffer's current size expressed
+ * in elements.
+ *
+ * buff ::
+ * The address of the buffer base pointer.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
Update_Max( FT_Memory memory,
FT_ULong* size,
@@ -359,28 +377,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Load_Context */
- /* */
- /* <Description> */
- /* Prepare an execution context for glyph hinting. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* size :: A handle to the source size object. */
- /* */
- /* <InOut> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Load_Context
+ *
+ * @Description:
+ * Prepare an execution context for glyph hinting.
+ *
+ * @Input:
+ * face ::
+ * A handle to the source face object.
+ *
+ * size ::
+ * A handle to the source size object.
+ *
+ * @InOut:
+ * exec ::
+ * A handle to the target execution context.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * @Note:
+ * Only the glyph loader and debugger should call this function.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Load_Context( TT_ExecContext exec,
TT_Face face,
@@ -467,23 +488,25 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Save_Context */
- /* */
- /* <Description> */
- /* Saves the code ranges in a `size' object. */
- /* */
- /* <Input> */
- /* exec :: A handle to the source execution context. */
- /* */
- /* <InOut> */
- /* size :: A handle to the target size object. */
- /* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Save_Context
+ *
+ * @Description:
+ * Saves the code ranges in a `size' object.
+ *
+ * @Input:
+ * exec ::
+ * A handle to the source execution context.
+ *
+ * @InOut:
+ * size ::
+ * A handle to the target size object.
+ *
+ * @Note:
+ * Only the glyph loader and debugger should call this function.
+ */
FT_LOCAL_DEF( void )
TT_Save_Context( TT_ExecContext exec,
TT_Size size )
@@ -505,27 +528,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_Run_Context */
- /* */
- /* <Description> */
- /* Executes one or more instructions in the execution context. */
- /* */
- /* <Input> */
- /* debug :: A Boolean flag. If set, the function sets some internal */
- /* variables and returns immediately, otherwise TT_RunIns() */
- /* is called. */
- /* */
- /* This is commented out currently. */
- /* */
- /* <Input> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* <Return> */
- /* TrueType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Run_Context
+ *
+ * @Description:
+ * Executes one or more instructions in the execution context.
+ *
+ * @Input:
+ * exec ::
+ * A handle to the target execution context.
+ *
+ * @Return:
+ * TrueType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
TT_Run_Context( TT_ExecContext exec )
{
@@ -609,22 +626,22 @@
}
- /*************************************************************************/
- /* */
- /* Before an opcode is executed, the interpreter verifies that there are */
- /* enough arguments on the stack, with the help of the `Pop_Push_Count' */
- /* table. */
- /* */
- /* For each opcode, the first column gives the number of arguments that */
- /* are popped from the stack; the second one gives the number of those */
- /* that are pushed in result. */
- /* */
- /* Opcodes which have a varying number of parameters in the data stream */
- /* (NPUSHB, NPUSHW) are handled specially; they have a negative value in */
- /* the `opcode_length' table, and the value in `Pop_Push_Count' is set */
- /* to zero. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Before an opcode is executed, the interpreter verifies that there are
+ * enough arguments on the stack, with the help of the `Pop_Push_Count'
+ * table.
+ *
+ * For each opcode, the first column gives the number of arguments that
+ * are popped from the stack; the second one gives the number of those
+ * that are pushed in result.
+ *
+ * Opcodes which have a varying number of parameters in the data stream
+ * (NPUSHB, NPUSHW) are handled specially; they have a negative value in
+ * the `opcode_length' table, and the value in `Pop_Push_Count' is set
+ * to zero.
+ *
+ */
#undef PACK
@@ -1129,73 +1146,73 @@
"8 PushW[6]",
"8 PushW[7]",
- "8 MDRP[00]",
- "8 MDRP[01]",
- "8 MDRP[02]",
- "8 MDRP[03]",
- "8 MDRP[04]",
- "8 MDRP[05]",
- "8 MDRP[06]",
- "8 MDRP[07]",
- "8 MDRP[08]",
- "8 MDRP[09]",
- "8 MDRP[10]",
- "8 MDRP[11]",
- "8 MDRP[12]",
- "8 MDRP[13]",
- "8 MDRP[14]",
- "8 MDRP[15]",
-
- "8 MDRP[16]",
- "8 MDRP[17]",
- "8 MDRP[18]",
- "8 MDRP[19]",
- "8 MDRP[20]",
- "8 MDRP[21]",
- "8 MDRP[22]",
- "8 MDRP[23]",
- "8 MDRP[24]",
- "8 MDRP[25]",
- "8 MDRP[26]",
- "8 MDRP[27]",
- "8 MDRP[28]",
- "8 MDRP[29]",
- "8 MDRP[30]",
- "8 MDRP[31]",
-
- "8 MIRP[00]",
- "8 MIRP[01]",
- "8 MIRP[02]",
- "8 MIRP[03]",
- "8 MIRP[04]",
- "8 MIRP[05]",
- "8 MIRP[06]",
- "8 MIRP[07]",
- "8 MIRP[08]",
- "8 MIRP[09]",
- "8 MIRP[10]",
- "8 MIRP[11]",
- "8 MIRP[12]",
- "8 MIRP[13]",
- "8 MIRP[14]",
- "8 MIRP[15]",
-
- "8 MIRP[16]",
- "8 MIRP[17]",
- "8 MIRP[18]",
- "8 MIRP[19]",
- "8 MIRP[20]",
- "8 MIRP[21]",
- "8 MIRP[22]",
- "8 MIRP[23]",
- "8 MIRP[24]",
- "8 MIRP[25]",
- "8 MIRP[26]",
- "8 MIRP[27]",
- "8 MIRP[28]",
- "8 MIRP[29]",
- "8 MIRP[30]",
- "8 MIRP[31]"
+ "7 MDRP[G]",
+ "7 MDRP[B]",
+ "7 MDRP[W]",
+ "7 MDRP[?]",
+ "8 MDRP[rG]",
+ "8 MDRP[rB]",
+ "8 MDRP[rW]",
+ "8 MDRP[r?]",
+ "8 MDRP[mG]",
+ "8 MDRP[mB]",
+ "8 MDRP[mW]",
+ "8 MDRP[m?]",
+ "9 MDRP[mrG]",
+ "9 MDRP[mrB]",
+ "9 MDRP[mrW]",
+ "9 MDRP[mr?]",
+
+ "8 MDRP[pG]",
+ "8 MDRP[pB]",
+ "8 MDRP[pW]",
+ "8 MDRP[p?]",
+ "9 MDRP[prG]",
+ "9 MDRP[prB]",
+ "9 MDRP[prW]",
+ "9 MDRP[pr?]",
+ "9 MDRP[pmG]",
+ "9 MDRP[pmB]",
+ "9 MDRP[pmW]",
+ "9 MDRP[pm?]",
+ "A MDRP[pmrG]",
+ "A MDRP[pmrB]",
+ "A MDRP[pmrW]",
+ "A MDRP[pmr?]",
+
+ "7 MIRP[G]",
+ "7 MIRP[B]",
+ "7 MIRP[W]",
+ "7 MIRP[?]",
+ "8 MIRP[rG]",
+ "8 MIRP[rB]",
+ "8 MIRP[rW]",
+ "8 MIRP[r?]",
+ "8 MIRP[mG]",
+ "8 MIRP[mB]",
+ "8 MIRP[mW]",
+ "8 MIRP[m?]",
+ "9 MIRP[mrG]",
+ "9 MIRP[mrB]",
+ "9 MIRP[mrW]",
+ "9 MIRP[mr?]",
+
+ "8 MIRP[pG]",
+ "8 MIRP[pB]",
+ "8 MIRP[pW]",
+ "8 MIRP[p?]",
+ "9 MIRP[prG]",
+ "9 MIRP[prB]",
+ "9 MIRP[prW]",
+ "9 MIRP[pr?]",
+ "9 MIRP[pmG]",
+ "9 MIRP[pmB]",
+ "9 MIRP[pmW]",
+ "9 MIRP[pm?]",
+ "A MIRP[pmrG]",
+ "A MIRP[pmrB]",
+ "A MIRP[pmrW]",
+ "A MIRP[pmr?]"
};
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -1448,18 +1465,18 @@
#endif /* TT_DotFix14 */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Current_Ratio */
- /* */
- /* <Description> */
- /* Returns the current aspect ratio scaling factor depending on the */
- /* projection vector's state and device resolutions. */
- /* */
- /* <Return> */
- /* The aspect ratio in 16.16 format, always <= 1.0 . */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Current_Ratio
+ *
+ * @Description:
+ * Returns the current aspect ratio scaling factor depending on the
+ * projection vector's state and device resolutions.
+ *
+ * @Return:
+ * The aspect ratio in 16.16 format, always <= 1.0 .
+ */
static FT_Long
Current_Ratio( TT_ExecContext exc )
{
@@ -1501,11 +1518,11 @@
}
- /*************************************************************************/
- /* */
- /* Functions related to the control value table (CVT). */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Functions related to the control value table (CVT).
+ *
+ */
FT_CALLBACK_DEF( FT_F26Dot6 )
@@ -1547,7 +1564,7 @@
FT_ULong idx,
FT_F26Dot6 value )
{
- exc->cvt[idx] += value;
+ exc->cvt[idx] = ADD_LONG( exc->cvt[idx], value );
}
@@ -1556,25 +1573,26 @@
FT_ULong idx,
FT_F26Dot6 value )
{
- exc->cvt[idx] += FT_DivFix( value, Current_Ratio( exc ) );
- }
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* GetShortIns */
- /* */
- /* <Description> */
- /* Returns a short integer taken from the instruction stream at */
- /* address IP. */
- /* */
- /* <Return> */
- /* Short read at code[IP]. */
- /* */
- /* <Note> */
- /* This one could become a macro. */
- /* */
+ exc->cvt[idx] = ADD_LONG( exc->cvt[idx],
+ FT_DivFix( value, Current_Ratio( exc ) ) );
+ }
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * GetShortIns
+ *
+ * @Description:
+ * Returns a short integer taken from the instruction stream at
+ * address IP.
+ *
+ * @Return:
+ * Short read at code[IP].
+ *
+ * @Note:
+ * This one could become a macro.
+ */
static FT_Short
GetShortIns( TT_ExecContext exc )
{
@@ -1585,22 +1603,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Ins_Goto_CodeRange */
- /* */
- /* <Description> */
- /* Goes to a certain code range in the instruction stream. */
- /* */
- /* <Input> */
- /* aRange :: The index of the code range. */
- /* */
- /* aIP :: The new IP address in the code range. */
- /* */
- /* <Return> */
- /* SUCCESS or FAILURE. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Ins_Goto_CodeRange
+ *
+ * @Description:
+ * Goes to a certain code range in the instruction stream.
+ *
+ * @Input:
+ * aRange ::
+ * The index of the code range.
+ *
+ * aIP ::
+ * The new IP address in the code range.
+ *
+ * @Return:
+ * SUCCESS or FAILURE.
+ */
static FT_Bool
Ins_Goto_CodeRange( TT_ExecContext exc,
FT_Int aRange,
@@ -1642,27 +1662,30 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Direct_Move */
- /* */
- /* <Description> */
- /* Moves a point by a given distance along the freedom vector. The */
- /* point will be `touched'. */
- /* */
- /* <Input> */
- /* point :: The index of the point to move. */
- /* */
- /* distance :: The distance to apply. */
- /* */
- /* <InOut> */
- /* zone :: The affected glyph zone. */
- /* */
- /* <Note> */
- /* See `ttinterp.h' for details on backward compatibility mode. */
- /* `Touches' the point. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Direct_Move
+ *
+ * @Description:
+ * Moves a point by a given distance along the freedom vector. The
+ * point will be `touched'.
+ *
+ * @Input:
+ * point ::
+ * The index of the point to move.
+ *
+ * distance ::
+ * The distance to apply.
+ *
+ * @InOut:
+ * zone ::
+ * The affected glyph zone.
+ *
+ * @Note:
+ * See `ttinterp.h' for details on backward compatibility mode.
+ * `Touches' the point.
+ */
static void
Direct_Move( TT_ExecContext exc,
TT_GlyphZone zone,
@@ -1728,23 +1751,26 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Direct_Move_Orig */
- /* */
- /* <Description> */
- /* Moves the *original* position of a point by a given distance along */
- /* the freedom vector. Obviously, the point will not be `touched'. */
- /* */
- /* <Input> */
- /* point :: The index of the point to move. */
- /* */
- /* distance :: The distance to apply. */
- /* */
- /* <InOut> */
- /* zone :: The affected glyph zone. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Direct_Move_Orig
+ *
+ * @Description:
+ * Moves the *original* position of a point by a given distance along
+ * the freedom vector. Obviously, the point will not be `touched'.
+ *
+ * @Input:
+ * point ::
+ * The index of the point to move.
+ *
+ * distance ::
+ * The distance to apply.
+ *
+ * @InOut:
+ * zone ::
+ * The affected glyph zone.
+ */
static void
Direct_Move_Orig( TT_ExecContext exc,
TT_GlyphZone zone,
@@ -1772,15 +1798,15 @@
}
- /*************************************************************************/
- /* */
- /* Special versions of Direct_Move() */
- /* */
- /* The following versions are used whenever both vectors are both */
- /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */
- /* See `ttinterp.h' for details on backward compatibility mode. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Special versions of Direct_Move()
+ *
+ * The following versions are used whenever both vectors are both
+ * along one of the coordinate unit vectors, i.e. in 90% of the cases.
+ * See `ttinterp.h' for details on backward compatibility mode.
+ *
+ */
static void
@@ -1827,14 +1853,14 @@
}
- /*************************************************************************/
- /* */
- /* Special versions of Direct_Move_Orig() */
- /* */
- /* The following versions are used whenever both vectors are both */
- /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Special versions of Direct_Move_Orig()
+ *
+ * The following versions are used whenever both vectors are both
+ * along one of the coordinate unit vectors, i.e. in 90% of the cases.
+ *
+ */
static void
@@ -1861,28 +1887,30 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_None */
- /* */
- /* <Description> */
- /* Does not round, but adds engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance (not) to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* The compensated distance. */
- /* */
- /* <Note> */
- /* The TrueType specification says very few about the relationship */
- /* between rounding and engine compensation. However, it seems from */
- /* the description of super round that we should add the compensation */
- /* before rounding. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_None
+ *
+ * @Description:
+ * Does not round, but adds engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance (not) to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * The compensated distance.
+ *
+ * @Note:
+ * The TrueType specification says very few about the relationship
+ * between rounding and engine compensation. However, it seems from
+ * the description of super round that we should add the compensation
+ * before rounding.
+ */
static FT_F26Dot6
Round_None( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -1909,22 +1937,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_To_Grid */
- /* */
- /* <Description> */
- /* Rounds value to grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_To_Grid
+ *
+ * @Description:
+ * Rounds value to grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ */
static FT_F26Dot6
Round_To_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -1953,22 +1983,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_To_Half_Grid */
- /* */
- /* <Description> */
- /* Rounds value to half grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_To_Half_Grid
+ *
+ * @Description:
+ * Rounds value to half grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ */
static FT_F26Dot6
Round_To_Half_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -1999,22 +2031,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_Down_To_Grid */
- /* */
- /* <Description> */
- /* Rounds value down to grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_Down_To_Grid
+ *
+ * @Description:
+ * Rounds value down to grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ */
static FT_F26Dot6
Round_Down_To_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -2042,22 +2076,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_Up_To_Grid */
- /* */
- /* <Description> */
- /* Rounds value up to grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_Up_To_Grid
+ *
+ * @Description:
+ * Rounds value up to grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ */
static FT_F26Dot6
Round_Up_To_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -2086,22 +2122,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_To_Double_Grid */
- /* */
- /* <Description> */
- /* Rounds value to double grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_To_Double_Grid
+ *
+ * @Description:
+ * Rounds value to double grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ */
static FT_F26Dot6
Round_To_Double_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -2130,28 +2168,30 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_Super */
- /* */
- /* <Description> */
- /* Super-rounds value to grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
- /* <Note> */
- /* The TrueType specification says very little about the relationship */
- /* between rounding and engine compensation. However, it seems from */
- /* the description of super round that we should add the compensation */
- /* before rounding. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_Super
+ *
+ * @Description:
+ * Super-rounds value to grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ *
+ * @Note:
+ * The TrueType specification says very little about the relationship
+ * between rounding and engine compensation. However, it seems from
+ * the description of super round that we should add the compensation
+ * before rounding.
+ */
static FT_F26Dot6
Round_Super( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -2183,26 +2223,28 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Round_Super_45 */
- /* */
- /* <Description> */
- /* Super-rounds value to grid after adding engine compensation. */
- /* */
- /* <Input> */
- /* distance :: The distance to round. */
- /* */
- /* compensation :: The engine compensation. */
- /* */
- /* <Return> */
- /* Rounded distance. */
- /* */
- /* <Note> */
- /* There is a separate function for Round_Super_45() as we may need */
- /* greater precision. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Round_Super_45
+ *
+ * @Description:
+ * Super-rounds value to grid after adding engine compensation.
+ *
+ * @Input:
+ * distance ::
+ * The distance to round.
+ *
+ * compensation ::
+ * The engine compensation.
+ *
+ * @Return:
+ * Rounded distance.
+ *
+ * @Note:
+ * There is a separate function for Round_Super_45() as we may need
+ * greater precision.
+ */
static FT_F26Dot6
Round_Super_45( TT_ExecContext exc,
FT_F26Dot6 distance,
@@ -2234,17 +2276,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Compute_Round */
- /* */
- /* <Description> */
- /* Sets the rounding mode. */
- /* */
- /* <Input> */
- /* round_mode :: The rounding mode to be used. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Compute_Round
+ *
+ * @Description:
+ * Sets the rounding mode.
+ *
+ * @Input:
+ * round_mode ::
+ * The rounding mode to be used.
+ */
static void
Compute_Round( TT_ExecContext exc,
FT_Byte round_mode )
@@ -2286,19 +2329,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* SetSuperRound */
- /* */
- /* <Description> */
- /* Sets Super Round parameters. */
- /* */
- /* <Input> */
- /* GridPeriod :: The grid period. */
- /* */
- /* selector :: The SROUND opcode. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * SetSuperRound
+ *
+ * @Description:
+ * Sets Super Round parameters.
+ *
+ * @Input:
+ * GridPeriod ::
+ * The grid period.
+ *
+ * selector ::
+ * The SROUND opcode.
+ */
static void
SetSuperRound( TT_ExecContext exc,
FT_F2Dot14 GridPeriod,
@@ -2355,22 +2400,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Project */
- /* */
- /* <Description> */
- /* Computes the projection of vector given by (v2-v1) along the */
- /* current projection vector. */
- /* */
- /* <Input> */
- /* v1 :: First input vector. */
- /* v2 :: Second input vector. */
- /* */
- /* <Return> */
- /* The distance in F26dot6 format. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Project
+ *
+ * @Description:
+ * Computes the projection of vector given by (v2-v1) along the
+ * current projection vector.
+ *
+ * @Input:
+ * v1 ::
+ * First input vector.
+ * v2 ::
+ * Second input vector.
+ *
+ * @Return:
+ * The distance in F26dot6 format.
+ */
static FT_F26Dot6
Project( TT_ExecContext exc,
FT_Pos dx,
@@ -2382,22 +2429,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Dual_Project */
- /* */
- /* <Description> */
- /* Computes the projection of the vector given by (v2-v1) along the */
- /* current dual vector. */
- /* */
- /* <Input> */
- /* v1 :: First input vector. */
- /* v2 :: Second input vector. */
- /* */
- /* <Return> */
- /* The distance in F26dot6 format. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Dual_Project
+ *
+ * @Description:
+ * Computes the projection of the vector given by (v2-v1) along the
+ * current dual vector.
+ *
+ * @Input:
+ * v1 ::
+ * First input vector.
+ * v2 ::
+ * Second input vector.
+ *
+ * @Return:
+ * The distance in F26dot6 format.
+ */
static FT_F26Dot6
Dual_Project( TT_ExecContext exc,
FT_Pos dx,
@@ -2409,22 +2458,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Project_x */
- /* */
- /* <Description> */
- /* Computes the projection of the vector given by (v2-v1) along the */
- /* horizontal axis. */
- /* */
- /* <Input> */
- /* v1 :: First input vector. */
- /* v2 :: Second input vector. */
- /* */
- /* <Return> */
- /* The distance in F26dot6 format. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Project_x
+ *
+ * @Description:
+ * Computes the projection of the vector given by (v2-v1) along the
+ * horizontal axis.
+ *
+ * @Input:
+ * v1 ::
+ * First input vector.
+ * v2 ::
+ * Second input vector.
+ *
+ * @Return:
+ * The distance in F26dot6 format.
+ */
static FT_F26Dot6
Project_x( TT_ExecContext exc,
FT_Pos dx,
@@ -2437,22 +2488,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Project_y */
- /* */
- /* <Description> */
- /* Computes the projection of the vector given by (v2-v1) along the */
- /* vertical axis. */
- /* */
- /* <Input> */
- /* v1 :: First input vector. */
- /* v2 :: Second input vector. */
- /* */
- /* <Return> */
- /* The distance in F26dot6 format. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Project_y
+ *
+ * @Description:
+ * Computes the projection of the vector given by (v2-v1) along the
+ * vertical axis.
+ *
+ * @Input:
+ * v1 ::
+ * First input vector.
+ * v2 ::
+ * Second input vector.
+ *
+ * @Return:
+ * The distance in F26dot6 format.
+ */
static FT_F26Dot6
Project_y( TT_ExecContext exc,
FT_Pos dx,
@@ -2465,15 +2518,15 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Compute_Funcs */
- /* */
- /* <Description> */
- /* Computes the projection and movement function pointers according */
- /* to the current graphics state. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Compute_Funcs
+ *
+ * @Description:
+ * Computes the projection and movement function pointers according
+ * to the current graphics state.
+ */
static void
Compute_Funcs( TT_ExecContext exc )
{
@@ -2528,28 +2581,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Normalize */
- /* */
- /* <Description> */
- /* Norms a vector. */
- /* */
- /* <Input> */
- /* Vx :: The horizontal input vector coordinate. */
- /* Vy :: The vertical input vector coordinate. */
- /* */
- /* <Output> */
- /* R :: The normed unit vector. */
- /* */
- /* <Return> */
- /* Returns FAILURE if a vector parameter is zero. */
- /* */
- /* <Note> */
- /* In case Vx and Vy are both zero, `Normalize' returns SUCCESS, and */
- /* R is undefined. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Normalize
+ *
+ * @Description:
+ * Norms a vector.
+ *
+ * @Input:
+ * Vx ::
+ * The horizontal input vector coordinate.
+ * Vy ::
+ * The vertical input vector coordinate.
+ *
+ * @Output:
+ * R ::
+ * The normed unit vector.
+ *
+ * @Return:
+ * Returns FAILURE if a vector parameter is zero.
+ *
+ * @Note:
+ * In case Vx and Vy are both zero, `Normalize' returns SUCCESS, and
+ * R is undefined.
+ */
static FT_Bool
Normalize( FT_F26Dot6 Vx,
FT_F26Dot6 Vy,
@@ -2577,11 +2633,11 @@
}
- /*************************************************************************/
- /* */
- /* Here we start with the implementation of the various opcodes. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Here we start with the implementation of the various opcodes.
+ *
+ */
#define ARRAY_BOUND_ERROR \
@@ -2592,12 +2648,12 @@
} while (0)
- /*************************************************************************/
- /* */
- /* MPPEM[]: Measure Pixel Per EM */
- /* Opcode range: 0x4B */
- /* Stack: --> Euint16 */
- /* */
+ /**************************************************************************
+ *
+ * MPPEM[]: Measure Pixel Per EM
+ * Opcode range: 0x4B
+ * Stack: --> Euint16
+ */
static void
Ins_MPPEM( TT_ExecContext exc,
FT_Long* args )
@@ -2606,12 +2662,12 @@
}
- /*************************************************************************/
- /* */
- /* MPS[]: Measure Point Size */
- /* Opcode range: 0x4C */
- /* Stack: --> Euint16 */
- /* */
+ /**************************************************************************
+ *
+ * MPS[]: Measure Point Size
+ * Opcode range: 0x4C
+ * Stack: --> Euint16
+ */
static void
Ins_MPS( TT_ExecContext exc,
FT_Long* args )
@@ -2633,12 +2689,12 @@
}
- /*************************************************************************/
- /* */
- /* DUP[]: DUPlicate the stack's top element */
- /* Opcode range: 0x20 */
- /* Stack: StkElt --> StkElt StkElt */
- /* */
+ /**************************************************************************
+ *
+ * DUP[]: DUPlicate the stack's top element
+ * Opcode range: 0x20
+ * Stack: StkElt --> StkElt StkElt
+ */
static void
Ins_DUP( FT_Long* args )
{
@@ -2646,12 +2702,12 @@
}
- /*************************************************************************/
- /* */
- /* POP[]: POP the stack's top element */
- /* Opcode range: 0x21 */
- /* Stack: StkElt --> */
- /* */
+ /**************************************************************************
+ *
+ * POP[]: POP the stack's top element
+ * Opcode range: 0x21
+ * Stack: StkElt -->
+ */
static void
Ins_POP( void )
{
@@ -2659,12 +2715,12 @@
}
- /*************************************************************************/
- /* */
- /* CLEAR[]: CLEAR the entire stack */
- /* Opcode range: 0x22 */
- /* Stack: StkElt... --> */
- /* */
+ /**************************************************************************
+ *
+ * CLEAR[]: CLEAR the entire stack
+ * Opcode range: 0x22
+ * Stack: StkElt... -->
+ */
static void
Ins_CLEAR( TT_ExecContext exc )
{
@@ -2672,12 +2728,12 @@
}
- /*************************************************************************/
- /* */
- /* SWAP[]: SWAP the stack's top two elements */
- /* Opcode range: 0x23 */
- /* Stack: 2 * StkElt --> 2 * StkElt */
- /* */
+ /**************************************************************************
+ *
+ * SWAP[]: SWAP the stack's top two elements
+ * Opcode range: 0x23
+ * Stack: 2 * StkElt --> 2 * StkElt
+ */
static void
Ins_SWAP( FT_Long* args )
{
@@ -2690,12 +2746,12 @@
}
- /*************************************************************************/
- /* */
- /* DEPTH[]: return the stack DEPTH */
- /* Opcode range: 0x24 */
- /* Stack: --> uint32 */
- /* */
+ /**************************************************************************
+ *
+ * DEPTH[]: return the stack DEPTH
+ * Opcode range: 0x24
+ * Stack: --> uint32
+ */
static void
Ins_DEPTH( TT_ExecContext exc,
FT_Long* args )
@@ -2704,12 +2760,12 @@
}
- /*************************************************************************/
- /* */
- /* LT[]: Less Than */
- /* Opcode range: 0x50 */
- /* Stack: int32? int32? --> bool */
- /* */
+ /**************************************************************************
+ *
+ * LT[]: Less Than
+ * Opcode range: 0x50
+ * Stack: int32? int32? --> bool
+ */
static void
Ins_LT( FT_Long* args )
{
@@ -2717,12 +2773,12 @@
}
- /*************************************************************************/
- /* */
- /* LTEQ[]: Less Than or EQual */
- /* Opcode range: 0x51 */
- /* Stack: int32? int32? --> bool */
- /* */
+ /**************************************************************************
+ *
+ * LTEQ[]: Less Than or EQual
+ * Opcode range: 0x51
+ * Stack: int32? int32? --> bool
+ */
static void
Ins_LTEQ( FT_Long* args )
{
@@ -2730,12 +2786,12 @@
}
- /*************************************************************************/
- /* */
- /* GT[]: Greater Than */
- /* Opcode range: 0x52 */
- /* Stack: int32? int32? --> bool */
- /* */
+ /**************************************************************************
+ *
+ * GT[]: Greater Than
+ * Opcode range: 0x52
+ * Stack: int32? int32? --> bool
+ */
static void
Ins_GT( FT_Long* args )
{
@@ -2743,12 +2799,12 @@
}
- /*************************************************************************/
- /* */
- /* GTEQ[]: Greater Than or EQual */
- /* Opcode range: 0x53 */
- /* Stack: int32? int32? --> bool */
- /* */
+ /**************************************************************************
+ *
+ * GTEQ[]: Greater Than or EQual
+ * Opcode range: 0x53
+ * Stack: int32? int32? --> bool
+ */
static void
Ins_GTEQ( FT_Long* args )
{
@@ -2756,12 +2812,12 @@
}
- /*************************************************************************/
- /* */
- /* EQ[]: EQual */
- /* Opcode range: 0x54 */
- /* Stack: StkElt StkElt --> bool */
- /* */
+ /**************************************************************************
+ *
+ * EQ[]: EQual
+ * Opcode range: 0x54
+ * Stack: StkElt StkElt --> bool
+ */
static void
Ins_EQ( FT_Long* args )
{
@@ -2769,12 +2825,12 @@
}
- /*************************************************************************/
- /* */
- /* NEQ[]: Not EQual */
- /* Opcode range: 0x55 */
- /* Stack: StkElt StkElt --> bool */
- /* */
+ /**************************************************************************
+ *
+ * NEQ[]: Not EQual
+ * Opcode range: 0x55
+ * Stack: StkElt StkElt --> bool
+ */
static void
Ins_NEQ( FT_Long* args )
{
@@ -2782,12 +2838,12 @@
}
- /*************************************************************************/
- /* */
- /* ODD[]: Is ODD */
- /* Opcode range: 0x56 */
- /* Stack: f26.6 --> bool */
- /* */
+ /**************************************************************************
+ *
+ * ODD[]: Is ODD
+ * Opcode range: 0x56
+ * Stack: f26.6 --> bool
+ */
static void
Ins_ODD( TT_ExecContext exc,
FT_Long* args )
@@ -2796,12 +2852,12 @@
}
- /*************************************************************************/
- /* */
- /* EVEN[]: Is EVEN */
- /* Opcode range: 0x57 */
- /* Stack: f26.6 --> bool */
- /* */
+ /**************************************************************************
+ *
+ * EVEN[]: Is EVEN
+ * Opcode range: 0x57
+ * Stack: f26.6 --> bool
+ */
static void
Ins_EVEN( TT_ExecContext exc,
FT_Long* args )
@@ -2810,12 +2866,12 @@
}
- /*************************************************************************/
- /* */
- /* AND[]: logical AND */
- /* Opcode range: 0x5A */
- /* Stack: uint32 uint32 --> uint32 */
- /* */
+ /**************************************************************************
+ *
+ * AND[]: logical AND
+ * Opcode range: 0x5A
+ * Stack: uint32 uint32 --> uint32
+ */
static void
Ins_AND( FT_Long* args )
{
@@ -2823,12 +2879,12 @@
}
- /*************************************************************************/
- /* */
- /* OR[]: logical OR */
- /* Opcode range: 0x5B */
- /* Stack: uint32 uint32 --> uint32 */
- /* */
+ /**************************************************************************
+ *
+ * OR[]: logical OR
+ * Opcode range: 0x5B
+ * Stack: uint32 uint32 --> uint32
+ */
static void
Ins_OR( FT_Long* args )
{
@@ -2836,12 +2892,12 @@
}
- /*************************************************************************/
- /* */
- /* NOT[]: logical NOT */
- /* Opcode range: 0x5C */
- /* Stack: StkElt --> uint32 */
- /* */
+ /**************************************************************************
+ *
+ * NOT[]: logical NOT
+ * Opcode range: 0x5C
+ * Stack: StkElt --> uint32
+ */
static void
Ins_NOT( FT_Long* args )
{
@@ -2849,12 +2905,12 @@
}
- /*************************************************************************/
- /* */
- /* ADD[]: ADD */
- /* Opcode range: 0x60 */
- /* Stack: f26.6 f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * ADD[]: ADD
+ * Opcode range: 0x60
+ * Stack: f26.6 f26.6 --> f26.6
+ */
static void
Ins_ADD( FT_Long* args )
{
@@ -2862,12 +2918,12 @@
}
- /*************************************************************************/
- /* */
- /* SUB[]: SUBtract */
- /* Opcode range: 0x61 */
- /* Stack: f26.6 f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * SUB[]: SUBtract
+ * Opcode range: 0x61
+ * Stack: f26.6 f26.6 --> f26.6
+ */
static void
Ins_SUB( FT_Long* args )
{
@@ -2875,12 +2931,12 @@
}
- /*************************************************************************/
- /* */
- /* DIV[]: DIVide */
- /* Opcode range: 0x62 */
- /* Stack: f26.6 f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * DIV[]: DIVide
+ * Opcode range: 0x62
+ * Stack: f26.6 f26.6 --> f26.6
+ */
static void
Ins_DIV( TT_ExecContext exc,
FT_Long* args )
@@ -2892,12 +2948,12 @@
}
- /*************************************************************************/
- /* */
- /* MUL[]: MULtiply */
- /* Opcode range: 0x63 */
- /* Stack: f26.6 f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * MUL[]: MULtiply
+ * Opcode range: 0x63
+ * Stack: f26.6 f26.6 --> f26.6
+ */
static void
Ins_MUL( FT_Long* args )
{
@@ -2905,12 +2961,12 @@
}
- /*************************************************************************/
- /* */
- /* ABS[]: ABSolute value */
- /* Opcode range: 0x64 */
- /* Stack: f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * ABS[]: ABSolute value
+ * Opcode range: 0x64
+ * Stack: f26.6 --> f26.6
+ */
static void
Ins_ABS( FT_Long* args )
{
@@ -2919,12 +2975,12 @@
}
- /*************************************************************************/
- /* */
- /* NEG[]: NEGate */
- /* Opcode range: 0x65 */
- /* Stack: f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * NEG[]: NEGate
+ * Opcode range: 0x65
+ * Stack: f26.6 --> f26.6
+ */
static void
Ins_NEG( FT_Long* args )
{
@@ -2932,12 +2988,12 @@
}
- /*************************************************************************/
- /* */
- /* FLOOR[]: FLOOR */
- /* Opcode range: 0x66 */
- /* Stack: f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * FLOOR[]: FLOOR
+ * Opcode range: 0x66
+ * Stack: f26.6 --> f26.6
+ */
static void
Ins_FLOOR( FT_Long* args )
{
@@ -2945,12 +3001,12 @@
}
- /*************************************************************************/
- /* */
- /* CEILING[]: CEILING */
- /* Opcode range: 0x67 */
- /* Stack: f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * CEILING[]: CEILING
+ * Opcode range: 0x67
+ * Stack: f26.6 --> f26.6
+ */
static void
Ins_CEILING( FT_Long* args )
{
@@ -2958,12 +3014,12 @@
}
- /*************************************************************************/
- /* */
- /* RS[]: Read Store */
- /* Opcode range: 0x43 */
- /* Stack: uint32 --> uint32 */
- /* */
+ /**************************************************************************
+ *
+ * RS[]: Read Store
+ * Opcode range: 0x43
+ * Stack: uint32 --> uint32
+ */
static void
Ins_RS( TT_ExecContext exc,
FT_Long* args )
@@ -3004,12 +3060,12 @@
}
- /*************************************************************************/
- /* */
- /* WS[]: Write Store */
- /* Opcode range: 0x42 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * WS[]: Write Store
+ * Opcode range: 0x42
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_WS( TT_ExecContext exc,
FT_Long* args )
@@ -3027,12 +3083,12 @@
}
- /*************************************************************************/
- /* */
- /* WCVTP[]: Write CVT in Pixel units */
- /* Opcode range: 0x44 */
- /* Stack: f26.6 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * WCVTP[]: Write CVT in Pixel units
+ * Opcode range: 0x44
+ * Stack: f26.6 uint32 -->
+ */
static void
Ins_WCVTP( TT_ExecContext exc,
FT_Long* args )
@@ -3050,12 +3106,12 @@
}
- /*************************************************************************/
- /* */
- /* WCVTF[]: Write CVT in Funits */
- /* Opcode range: 0x70 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * WCVTF[]: Write CVT in Funits
+ * Opcode range: 0x70
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_WCVTF( TT_ExecContext exc,
FT_Long* args )
@@ -3073,12 +3129,12 @@
}
- /*************************************************************************/
- /* */
- /* RCVT[]: Read CVT */
- /* Opcode range: 0x45 */
- /* Stack: uint32 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * RCVT[]: Read CVT
+ * Opcode range: 0x45
+ * Stack: uint32 --> f26.6
+ */
static void
Ins_RCVT( TT_ExecContext exc,
FT_Long* args )
@@ -3098,12 +3154,12 @@
}
- /*************************************************************************/
- /* */
- /* AA[]: Adjust Angle */
- /* Opcode range: 0x7F */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * AA[]: Adjust Angle
+ * Opcode range: 0x7F
+ * Stack: uint32 -->
+ */
static void
Ins_AA( void )
{
@@ -3111,14 +3167,14 @@
}
- /*************************************************************************/
- /* */
- /* DEBUG[]: DEBUG. Unsupported. */
- /* Opcode range: 0x4F */
- /* Stack: uint32 --> */
- /* */
- /* Note: The original instruction pops a value from the stack. */
- /* */
+ /**************************************************************************
+ *
+ * DEBUG[]: DEBUG. Unsupported.
+ * Opcode range: 0x4F
+ * Stack: uint32 -->
+ *
+ * Note: The original instruction pops a value from the stack.
+ */
static void
Ins_DEBUG( TT_ExecContext exc )
{
@@ -3126,12 +3182,12 @@
}
- /*************************************************************************/
- /* */
- /* ROUND[ab]: ROUND value */
- /* Opcode range: 0x68-0x6B */
- /* Stack: f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * ROUND[ab]: ROUND value
+ * Opcode range: 0x68-0x6B
+ * Stack: f26.6 --> f26.6
+ */
static void
Ins_ROUND( TT_ExecContext exc,
FT_Long* args )
@@ -3143,12 +3199,12 @@
}
- /*************************************************************************/
- /* */
- /* NROUND[ab]: No ROUNDing of value */
- /* Opcode range: 0x6C-0x6F */
- /* Stack: f26.6 --> f26.6 */
- /* */
+ /**************************************************************************
+ *
+ * NROUND[ab]: No ROUNDing of value
+ * Opcode range: 0x6C-0x6F
+ * Stack: f26.6 --> f26.6
+ */
static void
Ins_NROUND( TT_ExecContext exc,
FT_Long* args )
@@ -3160,12 +3216,12 @@
}
- /*************************************************************************/
- /* */
- /* MAX[]: MAXimum */
- /* Opcode range: 0x8B */
- /* Stack: int32? int32? --> int32 */
- /* */
+ /**************************************************************************
+ *
+ * MAX[]: MAXimum
+ * Opcode range: 0x8B
+ * Stack: int32? int32? --> int32
+ */
static void
Ins_MAX( FT_Long* args )
{
@@ -3174,12 +3230,12 @@
}
- /*************************************************************************/
- /* */
- /* MIN[]: MINimum */
- /* Opcode range: 0x8C */
- /* Stack: int32? int32? --> int32 */
- /* */
+ /**************************************************************************
+ *
+ * MIN[]: MINimum
+ * Opcode range: 0x8C
+ * Stack: int32? int32? --> int32
+ */
static void
Ins_MIN( FT_Long* args )
{
@@ -3188,12 +3244,12 @@
}
- /*************************************************************************/
- /* */
- /* MINDEX[]: Move INDEXed element */
- /* Opcode range: 0x26 */
- /* Stack: int32? --> StkElt */
- /* */
+ /**************************************************************************
+ *
+ * MINDEX[]: Move INDEXed element
+ * Opcode range: 0x26
+ * Stack: int32? --> StkElt
+ */
static void
Ins_MINDEX( TT_ExecContext exc,
FT_Long* args )
@@ -3221,12 +3277,12 @@
}
- /*************************************************************************/
- /* */
- /* CINDEX[]: Copy INDEXed element */
- /* Opcode range: 0x25 */
- /* Stack: int32 --> StkElt */
- /* */
+ /**************************************************************************
+ *
+ * CINDEX[]: Copy INDEXed element
+ * Opcode range: 0x25
+ * Stack: int32 --> StkElt
+ */
static void
Ins_CINDEX( TT_ExecContext exc,
FT_Long* args )
@@ -3247,12 +3303,12 @@
}
- /*************************************************************************/
- /* */
- /* ROLL[]: ROLL top three elements */
- /* Opcode range: 0x8A */
- /* Stack: 3 * StkElt --> 3 * StkElt */
- /* */
+ /**************************************************************************
+ *
+ * ROLL[]: ROLL top three elements
+ * Opcode range: 0x8A
+ * Stack: 3 * StkElt --> 3 * StkElt
+ */
static void
Ins_ROLL( FT_Long* args )
{
@@ -3269,19 +3325,19 @@
}
- /*************************************************************************/
- /* */
- /* MANAGING THE FLOW OF CONTROL */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * MANAGING THE FLOW OF CONTROL
+ *
+ */
- /*************************************************************************/
- /* */
- /* SLOOP[]: Set LOOP variable */
- /* Opcode range: 0x17 */
- /* Stack: int32? --> */
- /* */
+ /**************************************************************************
+ *
+ * SLOOP[]: Set LOOP variable
+ * Opcode range: 0x17
+ * Stack: int32? -->
+ */
static void
Ins_SLOOP( TT_ExecContext exc,
FT_Long* args )
@@ -3323,12 +3379,12 @@
}
- /*************************************************************************/
- /* */
- /* IF[]: IF test */
- /* Opcode range: 0x58 */
- /* Stack: StkElt --> */
- /* */
+ /**************************************************************************
+ *
+ * IF[]: IF test
+ * Opcode range: 0x58
+ * Stack: StkElt -->
+ */
static void
Ins_IF( TT_ExecContext exc,
FT_Long* args )
@@ -3367,12 +3423,12 @@
}
- /*************************************************************************/
- /* */
- /* ELSE[]: ELSE */
- /* Opcode range: 0x1B */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * ELSE[]: ELSE
+ * Opcode range: 0x1B
+ * Stack: -->
+ */
static void
Ins_ELSE( TT_ExecContext exc )
{
@@ -3400,12 +3456,12 @@
}
- /*************************************************************************/
- /* */
- /* EIF[]: End IF */
- /* Opcode range: 0x59 */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * EIF[]: End IF
+ * Opcode range: 0x59
+ * Stack: -->
+ */
static void
Ins_EIF( void )
{
@@ -3413,12 +3469,12 @@
}
- /*************************************************************************/
- /* */
- /* JMPR[]: JuMP Relative */
- /* Opcode range: 0x1C */
- /* Stack: int32 --> */
- /* */
+ /**************************************************************************
+ *
+ * JMPR[]: JuMP Relative
+ * Opcode range: 0x1C
+ * Stack: int32 -->
+ */
static void
Ins_JMPR( TT_ExecContext exc,
FT_Long* args )
@@ -3448,12 +3504,12 @@
}
- /*************************************************************************/
- /* */
- /* JROT[]: Jump Relative On True */
- /* Opcode range: 0x78 */
- /* Stack: StkElt int32 --> */
- /* */
+ /**************************************************************************
+ *
+ * JROT[]: Jump Relative On True
+ * Opcode range: 0x78
+ * Stack: StkElt int32 -->
+ */
static void
Ins_JROT( TT_ExecContext exc,
FT_Long* args )
@@ -3463,12 +3519,12 @@
}
- /*************************************************************************/
- /* */
- /* JROF[]: Jump Relative On False */
- /* Opcode range: 0x79 */
- /* Stack: StkElt int32 --> */
- /* */
+ /**************************************************************************
+ *
+ * JROF[]: Jump Relative On False
+ * Opcode range: 0x79
+ * Stack: StkElt int32 -->
+ */
static void
Ins_JROF( TT_ExecContext exc,
FT_Long* args )
@@ -3478,19 +3534,19 @@
}
- /*************************************************************************/
- /* */
- /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * DEFINING AND USING FUNCTIONS AND INSTRUCTIONS
+ *
+ */
- /*************************************************************************/
- /* */
- /* FDEF[]: Function DEFinition */
- /* Opcode range: 0x2C */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * FDEF[]: Function DEFinition
+ * Opcode range: 0x2C
+ * Stack: uint32 -->
+ */
static void
Ins_FDEF( TT_ExecContext exc,
FT_Long* args )
@@ -3788,12 +3844,12 @@
}
- /*************************************************************************/
- /* */
- /* ENDF[]: END Function definition */
- /* Opcode range: 0x2D */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * ENDF[]: END Function definition
+ * Opcode range: 0x2D
+ * Stack: -->
+ */
static void
Ins_ENDF( TT_ExecContext exc )
{
@@ -3837,12 +3893,12 @@
}
- /*************************************************************************/
- /* */
- /* CALL[]: CALL function */
- /* Opcode range: 0x2B */
- /* Stack: uint32? --> */
- /* */
+ /**************************************************************************
+ *
+ * CALL[]: CALL function
+ * Opcode range: 0x2B
+ * Stack: uint32? -->
+ */
static void
Ins_CALL( TT_ExecContext exc,
FT_Long* args )
@@ -3926,12 +3982,12 @@
}
- /*************************************************************************/
- /* */
- /* LOOPCALL[]: LOOP and CALL function */
- /* Opcode range: 0x2A */
- /* Stack: uint32? Eint16? --> */
- /* */
+ /**************************************************************************
+ *
+ * LOOPCALL[]: LOOP and CALL function
+ * Opcode range: 0x2A
+ * Stack: uint32? Eint16? -->
+ */
static void
Ins_LOOPCALL( TT_ExecContext exc,
FT_Long* args )
@@ -4019,12 +4075,12 @@
}
- /*************************************************************************/
- /* */
- /* IDEF[]: Instruction DEFinition */
- /* Opcode range: 0x89 */
- /* Stack: Eint8 --> */
- /* */
+ /**************************************************************************
+ *
+ * IDEF[]: Instruction DEFinition
+ * Opcode range: 0x89
+ * Stack: Eint8 -->
+ */
static void
Ins_IDEF( TT_ExecContext exc,
FT_Long* args )
@@ -4094,19 +4150,19 @@
}
- /*************************************************************************/
- /* */
- /* PUSHING DATA ONTO THE INTERPRETER STACK */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * PUSHING DATA ONTO THE INTERPRETER STACK
+ *
+ */
- /*************************************************************************/
- /* */
- /* NPUSHB[]: PUSH N Bytes */
- /* Opcode range: 0x40 */
- /* Stack: --> uint32... */
- /* */
+ /**************************************************************************
+ *
+ * NPUSHB[]: PUSH N Bytes
+ * Opcode range: 0x40
+ * Stack: --> uint32...
+ */
static void
Ins_NPUSHB( TT_ExecContext exc,
FT_Long* args )
@@ -4129,12 +4185,12 @@
}
- /*************************************************************************/
- /* */
- /* NPUSHW[]: PUSH N Words */
- /* Opcode range: 0x41 */
- /* Stack: --> int32... */
- /* */
+ /**************************************************************************
+ *
+ * NPUSHW[]: PUSH N Words
+ * Opcode range: 0x41
+ * Stack: --> int32...
+ */
static void
Ins_NPUSHW( TT_ExecContext exc,
FT_Long* args )
@@ -4160,12 +4216,12 @@
}
- /*************************************************************************/
- /* */
- /* PUSHB[abc]: PUSH Bytes */
- /* Opcode range: 0xB0-0xB7 */
- /* Stack: --> uint32... */
- /* */
+ /**************************************************************************
+ *
+ * PUSHB[abc]: PUSH Bytes
+ * Opcode range: 0xB0-0xB7
+ * Stack: --> uint32...
+ */
static void
Ins_PUSHB( TT_ExecContext exc,
FT_Long* args )
@@ -4186,12 +4242,12 @@
}
- /*************************************************************************/
- /* */
- /* PUSHW[abc]: PUSH Words */
- /* Opcode range: 0xB8-0xBF */
- /* Stack: --> int32... */
- /* */
+ /**************************************************************************
+ *
+ * PUSHW[abc]: PUSH Words
+ * Opcode range: 0xB8-0xBF
+ * Stack: --> int32...
+ */
static void
Ins_PUSHW( TT_ExecContext exc,
FT_Long* args )
@@ -4216,11 +4272,11 @@
}
- /*************************************************************************/
- /* */
- /* MANAGING THE GRAPHICS STATE */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * MANAGING THE GRAPHICS STATE
+ *
+ */
static FT_Bool
@@ -4274,20 +4330,20 @@
}
- /*************************************************************************/
- /* */
- /* SVTCA[a]: Set (F and P) Vectors to Coordinate Axis */
- /* Opcode range: 0x00-0x01 */
- /* Stack: --> */
- /* */
- /* SPvTCA[a]: Set PVector to Coordinate Axis */
- /* Opcode range: 0x02-0x03 */
- /* Stack: --> */
- /* */
- /* SFvTCA[a]: Set FVector to Coordinate Axis */
- /* Opcode range: 0x04-0x05 */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * SVTCA[a]: Set (F and P) Vectors to Coordinate Axis
+ * Opcode range: 0x00-0x01
+ * Stack: -->
+ *
+ * SPvTCA[a]: Set PVector to Coordinate Axis
+ * Opcode range: 0x02-0x03
+ * Stack: -->
+ *
+ * SFvTCA[a]: Set FVector to Coordinate Axis
+ * Opcode range: 0x04-0x05
+ * Stack: -->
+ */
static void
Ins_SxyTCA( TT_ExecContext exc )
{
@@ -4318,12 +4374,12 @@
}
- /*************************************************************************/
- /* */
- /* SPvTL[a]: Set PVector To Line */
- /* Opcode range: 0x06-0x07 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SPvTL[a]: Set PVector To Line
+ * Opcode range: 0x06-0x07
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_SPVTL( TT_ExecContext exc,
FT_Long* args )
@@ -4339,12 +4395,12 @@
}
- /*************************************************************************/
- /* */
- /* SFvTL[a]: Set FVector To Line */
- /* Opcode range: 0x08-0x09 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SFvTL[a]: Set FVector To Line
+ * Opcode range: 0x08-0x09
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_SFVTL( TT_ExecContext exc,
FT_Long* args )
@@ -4359,12 +4415,12 @@
}
- /*************************************************************************/
- /* */
- /* SFvTPv[]: Set FVector To PVector */
- /* Opcode range: 0x0E */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * SFvTPv[]: Set FVector To PVector
+ * Opcode range: 0x0E
+ * Stack: -->
+ */
static void
Ins_SFVTPV( TT_ExecContext exc )
{
@@ -4373,12 +4429,12 @@
}
- /*************************************************************************/
- /* */
- /* SPvFS[]: Set PVector From Stack */
- /* Opcode range: 0x0A */
- /* Stack: f2.14 f2.14 --> */
- /* */
+ /**************************************************************************
+ *
+ * SPvFS[]: Set PVector From Stack
+ * Opcode range: 0x0A
+ * Stack: f2.14 f2.14 -->
+ */
static void
Ins_SPVFS( TT_ExecContext exc,
FT_Long* args )
@@ -4400,12 +4456,12 @@
}
- /*************************************************************************/
- /* */
- /* SFvFS[]: Set FVector From Stack */
- /* Opcode range: 0x0B */
- /* Stack: f2.14 f2.14 --> */
- /* */
+ /**************************************************************************
+ *
+ * SFvFS[]: Set FVector From Stack
+ * Opcode range: 0x0B
+ * Stack: f2.14 f2.14 -->
+ */
static void
Ins_SFVFS( TT_ExecContext exc,
FT_Long* args )
@@ -4425,12 +4481,12 @@
}
- /*************************************************************************/
- /* */
- /* GPv[]: Get Projection Vector */
- /* Opcode range: 0x0C */
- /* Stack: ef2.14 --> ef2.14 */
- /* */
+ /**************************************************************************
+ *
+ * GPv[]: Get Projection Vector
+ * Opcode range: 0x0C
+ * Stack: ef2.14 --> ef2.14
+ */
static void
Ins_GPV( TT_ExecContext exc,
FT_Long* args )
@@ -4440,12 +4496,12 @@
}
- /*************************************************************************/
- /* */
- /* GFv[]: Get Freedom Vector */
- /* Opcode range: 0x0D */
- /* Stack: ef2.14 --> ef2.14 */
- /* */
+ /**************************************************************************
+ *
+ * GFv[]: Get Freedom Vector
+ * Opcode range: 0x0D
+ * Stack: ef2.14 --> ef2.14
+ */
static void
Ins_GFV( TT_ExecContext exc,
FT_Long* args )
@@ -4455,12 +4511,12 @@
}
- /*************************************************************************/
- /* */
- /* SRP0[]: Set Reference Point 0 */
- /* Opcode range: 0x10 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SRP0[]: Set Reference Point 0
+ * Opcode range: 0x10
+ * Stack: uint32 -->
+ */
static void
Ins_SRP0( TT_ExecContext exc,
FT_Long* args )
@@ -4469,12 +4525,12 @@
}
- /*************************************************************************/
- /* */
- /* SRP1[]: Set Reference Point 1 */
- /* Opcode range: 0x11 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SRP1[]: Set Reference Point 1
+ * Opcode range: 0x11
+ * Stack: uint32 -->
+ */
static void
Ins_SRP1( TT_ExecContext exc,
FT_Long* args )
@@ -4483,12 +4539,12 @@
}
- /*************************************************************************/
- /* */
- /* SRP2[]: Set Reference Point 2 */
- /* Opcode range: 0x12 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SRP2[]: Set Reference Point 2
+ * Opcode range: 0x12
+ * Stack: uint32 -->
+ */
static void
Ins_SRP2( TT_ExecContext exc,
FT_Long* args )
@@ -4497,12 +4553,12 @@
}
- /*************************************************************************/
- /* */
- /* SMD[]: Set Minimum Distance */
- /* Opcode range: 0x1A */
- /* Stack: f26.6 --> */
- /* */
+ /**************************************************************************
+ *
+ * SMD[]: Set Minimum Distance
+ * Opcode range: 0x1A
+ * Stack: f26.6 -->
+ */
static void
Ins_SMD( TT_ExecContext exc,
FT_Long* args )
@@ -4511,12 +4567,12 @@
}
- /*************************************************************************/
- /* */
- /* SCVTCI[]: Set Control Value Table Cut In */
- /* Opcode range: 0x1D */
- /* Stack: f26.6 --> */
- /* */
+ /**************************************************************************
+ *
+ * SCVTCI[]: Set Control Value Table Cut In
+ * Opcode range: 0x1D
+ * Stack: f26.6 -->
+ */
static void
Ins_SCVTCI( TT_ExecContext exc,
FT_Long* args )
@@ -4525,12 +4581,12 @@
}
- /*************************************************************************/
- /* */
- /* SSWCI[]: Set Single Width Cut In */
- /* Opcode range: 0x1E */
- /* Stack: f26.6 --> */
- /* */
+ /**************************************************************************
+ *
+ * SSWCI[]: Set Single Width Cut In
+ * Opcode range: 0x1E
+ * Stack: f26.6 -->
+ */
static void
Ins_SSWCI( TT_ExecContext exc,
FT_Long* args )
@@ -4539,12 +4595,12 @@
}
- /*************************************************************************/
- /* */
- /* SSW[]: Set Single Width */
- /* Opcode range: 0x1F */
- /* Stack: int32? --> */
- /* */
+ /**************************************************************************
+ *
+ * SSW[]: Set Single Width
+ * Opcode range: 0x1F
+ * Stack: int32? -->
+ */
static void
Ins_SSW( TT_ExecContext exc,
FT_Long* args )
@@ -4554,12 +4610,12 @@
}
- /*************************************************************************/
- /* */
- /* FLIPON[]: Set auto-FLIP to ON */
- /* Opcode range: 0x4D */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * FLIPON[]: Set auto-FLIP to ON
+ * Opcode range: 0x4D
+ * Stack: -->
+ */
static void
Ins_FLIPON( TT_ExecContext exc )
{
@@ -4567,12 +4623,12 @@
}
- /*************************************************************************/
- /* */
- /* FLIPOFF[]: Set auto-FLIP to OFF */
- /* Opcode range: 0x4E */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * FLIPOFF[]: Set auto-FLIP to OFF
+ * Opcode range: 0x4E
+ * Stack: -->
+ */
static void
Ins_FLIPOFF( TT_ExecContext exc )
{
@@ -4580,12 +4636,12 @@
}
- /*************************************************************************/
- /* */
- /* SANGW[]: Set ANGle Weight */
- /* Opcode range: 0x7E */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SANGW[]: Set ANGle Weight
+ * Opcode range: 0x7E
+ * Stack: uint32 -->
+ */
static void
Ins_SANGW( void )
{
@@ -4593,12 +4649,12 @@
}
- /*************************************************************************/
- /* */
- /* SDB[]: Set Delta Base */
- /* Opcode range: 0x5E */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SDB[]: Set Delta Base
+ * Opcode range: 0x5E
+ * Stack: uint32 -->
+ */
static void
Ins_SDB( TT_ExecContext exc,
FT_Long* args )
@@ -4607,12 +4663,12 @@
}
- /*************************************************************************/
- /* */
- /* SDS[]: Set Delta Shift */
- /* Opcode range: 0x5F */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SDS[]: Set Delta Shift
+ * Opcode range: 0x5F
+ * Stack: uint32 -->
+ */
static void
Ins_SDS( TT_ExecContext exc,
FT_Long* args )
@@ -4624,12 +4680,12 @@
}
- /*************************************************************************/
- /* */
- /* RTHG[]: Round To Half Grid */
- /* Opcode range: 0x19 */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * RTHG[]: Round To Half Grid
+ * Opcode range: 0x19
+ * Stack: -->
+ */
static void
Ins_RTHG( TT_ExecContext exc )
{
@@ -4638,12 +4694,12 @@
}
- /*************************************************************************/
- /* */
- /* RTG[]: Round To Grid */
- /* Opcode range: 0x18 */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * RTG[]: Round To Grid
+ * Opcode range: 0x18
+ * Stack: -->
+ */
static void
Ins_RTG( TT_ExecContext exc )
{
@@ -4652,11 +4708,11 @@
}
- /*************************************************************************/
- /* RTDG[]: Round To Double Grid */
- /* Opcode range: 0x3D */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ * RTDG[]: Round To Double Grid
+ * Opcode range: 0x3D
+ * Stack: -->
+ */
static void
Ins_RTDG( TT_ExecContext exc )
{
@@ -4665,11 +4721,11 @@
}
- /*************************************************************************/
- /* RUTG[]: Round Up To Grid */
- /* Opcode range: 0x7C */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ * RUTG[]: Round Up To Grid
+ * Opcode range: 0x7C
+ * Stack: -->
+ */
static void
Ins_RUTG( TT_ExecContext exc )
{
@@ -4678,12 +4734,12 @@
}
- /*************************************************************************/
- /* */
- /* RDTG[]: Round Down To Grid */
- /* Opcode range: 0x7D */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * RDTG[]: Round Down To Grid
+ * Opcode range: 0x7D
+ * Stack: -->
+ */
static void
Ins_RDTG( TT_ExecContext exc )
{
@@ -4692,12 +4748,12 @@
}
- /*************************************************************************/
- /* */
- /* ROFF[]: Round OFF */
- /* Opcode range: 0x7A */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * ROFF[]: Round OFF
+ * Opcode range: 0x7A
+ * Stack: -->
+ */
static void
Ins_ROFF( TT_ExecContext exc )
{
@@ -4706,12 +4762,12 @@
}
- /*************************************************************************/
- /* */
- /* SROUND[]: Super ROUND */
- /* Opcode range: 0x76 */
- /* Stack: Eint8 --> */
- /* */
+ /**************************************************************************
+ *
+ * SROUND[]: Super ROUND
+ * Opcode range: 0x76
+ * Stack: Eint8 -->
+ */
static void
Ins_SROUND( TT_ExecContext exc,
FT_Long* args )
@@ -4723,12 +4779,12 @@
}
- /*************************************************************************/
- /* */
- /* S45ROUND[]: Super ROUND 45 degrees */
- /* Opcode range: 0x77 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * S45ROUND[]: Super ROUND 45 degrees
+ * Opcode range: 0x77
+ * Stack: uint32 -->
+ */
static void
Ins_S45ROUND( TT_ExecContext exc,
FT_Long* args )
@@ -4740,15 +4796,15 @@
}
- /*************************************************************************/
- /* */
- /* GC[a]: Get Coordinate projected onto */
- /* Opcode range: 0x46-0x47 */
- /* Stack: uint32 --> f26.6 */
- /* */
- /* XXX: UNDOCUMENTED: Measures from the original glyph must be taken */
- /* along the dual projection vector! */
- /* */
+ /**************************************************************************
+ *
+ * GC[a]: Get Coordinate projected onto
+ * Opcode range: 0x46-0x47
+ * Stack: uint32 --> f26.6
+ *
+ * XXX: UNDOCUMENTED: Measures from the original glyph must be taken
+ * along the dual projection vector!
+ */
static void
Ins_GC( TT_ExecContext exc,
FT_Long* args )
@@ -4777,16 +4833,16 @@
}
- /*************************************************************************/
- /* */
- /* SCFS[]: Set Coordinate From Stack */
- /* Opcode range: 0x48 */
- /* Stack: f26.6 uint32 --> */
- /* */
- /* Formula: */
- /* */
- /* OA := OA + ( value - OA.p )/( f.p ) * f */
- /* */
+ /**************************************************************************
+ *
+ * SCFS[]: Set Coordinate From Stack
+ * Opcode range: 0x48
+ * Stack: f26.6 uint32 -->
+ *
+ * Formula:
+ *
+ * OA := OA + ( value - OA.p )/( f.p ) * f
+ */
static void
Ins_SCFS( TT_ExecContext exc,
FT_Long* args )
@@ -4815,21 +4871,21 @@
}
- /*************************************************************************/
- /* */
- /* MD[a]: Measure Distance */
- /* Opcode range: 0x49-0x4A */
- /* Stack: uint32 uint32 --> f26.6 */
- /* */
- /* XXX: UNDOCUMENTED: Measure taken in the original glyph must be along */
- /* the dual projection vector. */
- /* */
- /* XXX: UNDOCUMENTED: Flag attributes are inverted! */
- /* 0 => measure distance in original outline */
- /* 1 => measure distance in grid-fitted outline */
- /* */
- /* XXX: UNDOCUMENTED: `zp0 - zp1', and not `zp2 - zp1! */
- /* */
+ /**************************************************************************
+ *
+ * MD[a]: Measure Distance
+ * Opcode range: 0x49-0x4A
+ * Stack: uint32 uint32 --> f26.6
+ *
+ * XXX: UNDOCUMENTED: Measure taken in the original glyph must be along
+ * the dual projection vector.
+ *
+ * XXX: UNDOCUMENTED: Flag attributes are inverted!
+ * 0 => measure distance in original outline
+ * 1 => measure distance in grid-fitted outline
+ *
+ * XXX: UNDOCUMENTED: `zp0 - zp1', and not `zp2 - zp1!
+ */
static void
Ins_MD( TT_ExecContext exc,
FT_Long* args )
@@ -4902,12 +4958,12 @@
}
- /*************************************************************************/
- /* */
- /* SDPvTL[a]: Set Dual PVector to Line */
- /* Opcode range: 0x86-0x87 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SDPvTL[a]: Set Dual PVector to Line
+ * Opcode range: 0x86-0x87
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_SDPVTL( TT_ExecContext exc,
FT_Long* args )
@@ -4985,12 +5041,12 @@
}
- /*************************************************************************/
- /* */
- /* SZP0[]: Set Zone Pointer 0 */
- /* Opcode range: 0x13 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SZP0[]: Set Zone Pointer 0
+ * Opcode range: 0x13
+ * Stack: uint32 -->
+ */
static void
Ins_SZP0( TT_ExecContext exc,
FT_Long* args )
@@ -5015,12 +5071,12 @@
}
- /*************************************************************************/
- /* */
- /* SZP1[]: Set Zone Pointer 1 */
- /* Opcode range: 0x14 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SZP1[]: Set Zone Pointer 1
+ * Opcode range: 0x14
+ * Stack: uint32 -->
+ */
static void
Ins_SZP1( TT_ExecContext exc,
FT_Long* args )
@@ -5045,12 +5101,12 @@
}
- /*************************************************************************/
- /* */
- /* SZP2[]: Set Zone Pointer 2 */
- /* Opcode range: 0x15 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SZP2[]: Set Zone Pointer 2
+ * Opcode range: 0x15
+ * Stack: uint32 -->
+ */
static void
Ins_SZP2( TT_ExecContext exc,
FT_Long* args )
@@ -5075,12 +5131,12 @@
}
- /*************************************************************************/
- /* */
- /* SZPS[]: Set Zone PointerS */
- /* Opcode range: 0x16 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SZPS[]: Set Zone PointerS
+ * Opcode range: 0x16
+ * Stack: uint32 -->
+ */
static void
Ins_SZPS( TT_ExecContext exc,
FT_Long* args )
@@ -5110,12 +5166,12 @@
}
- /*************************************************************************/
- /* */
- /* INSTCTRL[]: INSTruction ConTRoL */
- /* Opcode range: 0x8E */
- /* Stack: int32 int32 --> */
- /* */
+ /**************************************************************************
+ *
+ * INSTCTRL[]: INSTruction ConTRoL
+ * Opcode range: 0x8E
+ * Stack: int32 int32 -->
+ */
static void
Ins_INSTCTRL( TT_ExecContext exc,
FT_Long* args )
@@ -5172,12 +5228,12 @@
}
- /*************************************************************************/
- /* */
- /* SCANCTRL[]: SCAN ConTRoL */
- /* Opcode range: 0x85 */
- /* Stack: uint32? --> */
- /* */
+ /**************************************************************************
+ *
+ * SCANCTRL[]: SCAN ConTRoL
+ * Opcode range: 0x85
+ * Stack: uint32? -->
+ */
static void
Ins_SCANCTRL( TT_ExecContext exc,
FT_Long* args )
@@ -5219,12 +5275,12 @@
}
- /*************************************************************************/
- /* */
- /* SCANTYPE[]: SCAN TYPE */
- /* Opcode range: 0x8D */
- /* Stack: uint16 --> */
- /* */
+ /**************************************************************************
+ *
+ * SCANTYPE[]: SCAN TYPE
+ * Opcode range: 0x8D
+ * Stack: uint16 -->
+ */
static void
Ins_SCANTYPE( TT_ExecContext exc,
FT_Long* args )
@@ -5234,19 +5290,19 @@
}
- /*************************************************************************/
- /* */
- /* MANAGING OUTLINES */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * MANAGING OUTLINES
+ *
+ */
- /*************************************************************************/
- /* */
- /* FLIPPT[]: FLIP PoinT */
- /* Opcode range: 0x80 */
- /* Stack: uint32... --> */
- /* */
+ /**************************************************************************
+ *
+ * FLIPPT[]: FLIP PoinT
+ * Opcode range: 0x80
+ * Stack: uint32... -->
+ */
static void
Ins_FLIPPT( TT_ExecContext exc )
{
@@ -5295,12 +5351,12 @@
}
- /*************************************************************************/
- /* */
- /* FLIPRGON[]: FLIP RanGe ON */
- /* Opcode range: 0x81 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * FLIPRGON[]: FLIP RanGe ON
+ * Opcode range: 0x81
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_FLIPRGON( TT_ExecContext exc,
FT_Long* args )
@@ -5333,12 +5389,12 @@
}
- /*************************************************************************/
- /* */
- /* FLIPRGOFF: FLIP RanGe OFF */
- /* Opcode range: 0x82 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * FLIPRGOFF: FLIP RanGe OFF
+ * Opcode range: 0x82
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_FLIPRGOFF( TT_ExecContext exc,
FT_Long* args )
@@ -5450,12 +5506,12 @@
}
- /*************************************************************************/
- /* */
- /* SHP[a]: SHift Point by the last point */
- /* Opcode range: 0x32-0x33 */
- /* Stack: uint32... --> */
- /* */
+ /**************************************************************************
+ *
+ * SHP[a]: SHift Point by the last point
+ * Opcode range: 0x32-0x33
+ * Stack: uint32... -->
+ */
static void
Ins_SHP( TT_ExecContext exc )
{
@@ -5507,16 +5563,16 @@
}
- /*************************************************************************/
- /* */
- /* SHC[a]: SHift Contour */
- /* Opcode range: 0x34-35 */
- /* Stack: uint32 --> */
- /* */
- /* UNDOCUMENTED: According to Greg Hitchcock, there is one (virtual) */
- /* contour in the twilight zone, namely contour number */
- /* zero which includes all points of it. */
- /* */
+ /**************************************************************************
+ *
+ * SHC[a]: SHift Contour
+ * Opcode range: 0x34-35
+ * Stack: uint32 -->
+ *
+ * UNDOCUMENTED: According to Greg Hitchcock, there is one (virtual)
+ * contour in the twilight zone, namely contour number
+ * zero which includes all points of it.
+ */
static void
Ins_SHC( TT_ExecContext exc,
FT_Long* args )
@@ -5563,12 +5619,12 @@
}
- /*************************************************************************/
- /* */
- /* SHZ[a]: SHift Zone */
- /* Opcode range: 0x36-37 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * SHZ[a]: SHift Zone
+ * Opcode range: 0x36-37
+ * Stack: uint32 -->
+ */
static void
Ins_SHZ( TT_ExecContext exc,
FT_Long* args )
@@ -5611,12 +5667,12 @@
}
- /*************************************************************************/
- /* */
- /* SHPIX[]: SHift points by a PIXel amount */
- /* Opcode range: 0x38 */
- /* Stack: f26.6 uint32... --> */
- /* */
+ /**************************************************************************
+ *
+ * SHPIX[]: SHift points by a PIXel amount
+ * Opcode range: 0x38
+ * Stack: f26.6 uint32... -->
+ */
static void
Ins_SHPIX( TT_ExecContext exc,
FT_Long* args )
@@ -5771,12 +5827,12 @@
}
- /*************************************************************************/
- /* */
- /* MSIRP[a]: Move Stack Indirect Relative Position */
- /* Opcode range: 0x3A-0x3B */
- /* Stack: f26.6 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * MSIRP[a]: Move Stack Indirect Relative Position
+ * Opcode range: 0x3A-0x3B
+ * Stack: f26.6 uint32 -->
+ */
static void
Ins_MSIRP( TT_ExecContext exc,
FT_Long* args )
@@ -5846,12 +5902,12 @@
}
- /*************************************************************************/
- /* */
- /* MDAP[a]: Move Direct Absolute Point */
- /* Opcode range: 0x2E-0x2F */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * MDAP[a]: Move Direct Absolute Point
+ * Opcode range: 0x2E-0x2F
+ * Stack: uint32 -->
+ */
static void
Ins_MDAP( TT_ExecContext exc,
FT_Long* args )
@@ -5900,12 +5956,12 @@
}
- /*************************************************************************/
- /* */
- /* MIAP[a]: Move Indirect Absolute Point */
- /* Opcode range: 0x3E-0x3F */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * MIAP[a]: Move Indirect Absolute Point
+ * Opcode range: 0x3E-0x3F
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_MIAP( TT_ExecContext exc,
FT_Long* args )
@@ -6020,12 +6076,12 @@
}
- /*************************************************************************/
- /* */
- /* MDRP[abcde]: Move Direct Relative Point */
- /* Opcode range: 0xC0-0xDF */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * MDRP[abcde]: Move Direct Relative Point
+ * Opcode range: 0xC0-0xDF
+ * Stack: uint32 -->
+ */
static void
Ins_MDRP( TT_ExecContext exc,
FT_Long* args )
@@ -6164,12 +6220,12 @@
}
- /*************************************************************************/
- /* */
- /* MIRP[abcde]: Move Indirect Relative Point */
- /* Opcode range: 0xE0-0xFF */
- /* Stack: int32? uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * MIRP[abcde]: Move Indirect Relative Point
+ * Opcode range: 0xE0-0xFF
+ * Stack: int32? uint32 -->
+ */
static void
Ins_MIRP( TT_ExecContext exc,
FT_Long* args )
@@ -6189,6 +6245,8 @@
FT_Bool reverse_move = FALSE;
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+ FT_F26Dot6 delta;
+
minimum_distance = exc->GS.minimum_distance;
control_value_cutin = exc->GS.control_value_cutin;
@@ -6221,8 +6279,11 @@
/* single width test */
- if ( FT_ABS( cvt_dist - exc->GS.single_width_value ) <
- exc->GS.single_width_cutin )
+ delta = SUB_LONG( cvt_dist, exc->GS.single_width_value );
+ if ( delta < 0 )
+ delta = NEG_LONG( delta );
+
+ if ( delta < exc->GS.single_width_cutin )
{
if ( cvt_dist >= 0 )
cvt_dist = exc->GS.single_width_value;
@@ -6251,7 +6312,7 @@
if ( exc->GS.auto_flip )
{
if ( ( org_dist ^ cvt_dist ) < 0 )
- cvt_dist = -cvt_dist;
+ cvt_dist = NEG_LONG( cvt_dist );
}
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -6276,9 +6337,6 @@
if ( exc->GS.gep0 == exc->GS.gep1 )
{
- FT_F26Dot6 delta;
-
-
/* XXX: According to Greg Hitchcock, the following wording is */
/* the right one: */
/* */
@@ -6313,9 +6371,6 @@
exc->ignore_x_mode &&
exc->GS.gep0 == exc->GS.gep1 )
{
- FT_F26Dot6 delta;
-
-
delta = SUB_LONG( cvt_dist, org_dist );
if ( delta < 0 )
delta = NEG_LONG( delta );
@@ -6412,12 +6467,12 @@
}
- /*************************************************************************/
- /* */
- /* ALIGNRP[]: ALIGN Relative Point */
- /* Opcode range: 0x3C */
- /* Stack: uint32 uint32... --> */
- /* */
+ /**************************************************************************
+ *
+ * ALIGNRP[]: ALIGN Relative Point
+ * Opcode range: 0x3C
+ * Stack: uint32 uint32... -->
+ */
static void
Ins_ALIGNRP( TT_ExecContext exc )
{
@@ -6475,12 +6530,12 @@
}
- /*************************************************************************/
- /* */
- /* ISECT[]: moves point to InterSECTion */
- /* Opcode range: 0x0F */
- /* Stack: 5 * uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * ISECT[]: moves point to InterSECTion
+ * Opcode range: 0x0F
+ * Stack: 5 * uint32 -->
+ */
static void
Ins_ISECT( TT_ExecContext exc,
FT_Long* args )
@@ -6571,12 +6626,12 @@
}
- /*************************************************************************/
- /* */
- /* ALIGNPTS[]: ALIGN PoinTS */
- /* Opcode range: 0x27 */
- /* Stack: uint32 uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * ALIGNPTS[]: ALIGN PoinTS
+ * Opcode range: 0x27
+ * Stack: uint32 uint32 -->
+ */
static void
Ins_ALIGNPTS( TT_ExecContext exc,
FT_Long* args )
@@ -6603,12 +6658,12 @@
}
- /*************************************************************************/
- /* */
- /* IP[]: Interpolate Point */
- /* Opcode range: 0x39 */
- /* Stack: uint32... --> */
- /* */
+ /**************************************************************************
+ *
+ * IP[]: Interpolate Point
+ * Opcode range: 0x39
+ * Stack: uint32... -->
+ */
/* SOMETIMES, DUMBER CODE IS BETTER CODE */
@@ -6763,12 +6818,12 @@
}
- /*************************************************************************/
- /* */
- /* UTP[a]: UnTouch Point */
- /* Opcode range: 0x29 */
- /* Stack: uint32 --> */
- /* */
+ /**************************************************************************
+ *
+ * UTP[a]: UnTouch Point
+ * Opcode range: 0x29
+ * Stack: uint32 -->
+ */
static void
Ins_UTP( TT_ExecContext exc,
FT_Long* args )
@@ -6932,12 +6987,12 @@
}
- /*************************************************************************/
- /* */
- /* IUP[a]: Interpolate Untouched Points */
- /* Opcode range: 0x30-0x31 */
- /* Stack: --> */
- /* */
+ /**************************************************************************
+ *
+ * IUP[a]: Interpolate Untouched Points
+ * Opcode range: 0x30-0x31
+ * Stack: -->
+ */
static void
Ins_IUP( TT_ExecContext exc )
{
@@ -7060,12 +7115,12 @@
}
- /*************************************************************************/
- /* */
- /* DELTAPn[]: DELTA exceptions P1, P2, P3 */
- /* Opcode range: 0x5D,0x71,0x72 */
- /* Stack: uint32 (2 * uint32)... --> */
- /* */
+ /**************************************************************************
+ *
+ * DELTAPn[]: DELTA exceptions P1, P2, P3
+ * Opcode range: 0x5D,0x71,0x72
+ * Stack: uint32 (2 * uint32)... -->
+ */
static void
Ins_DELTAP( TT_ExecContext exc,
FT_Long* args )
@@ -7142,12 +7197,12 @@
if ( SUBPIXEL_HINTING_INFINALITY )
{
/*
- * Allow delta move if
+ * Allow delta move if
*
- * - not using ignore_x_mode rendering,
- * - glyph is specifically set to allow it, or
- * - glyph is composite and freedom vector is not in subpixel
- * direction.
+ * - not using ignore_x_mode rendering,
+ * - glyph is specifically set to allow it, or
+ * - glyph is composite and freedom vector is not in subpixel
+ * direction.
*/
if ( !exc->ignore_x_mode ||
( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
@@ -7227,12 +7282,12 @@
}
- /*************************************************************************/
- /* */
- /* DELTACn[]: DELTA exceptions C1, C2, C3 */
- /* Opcode range: 0x73,0x74,0x75 */
- /* Stack: uint32 (2 * uint32)... --> */
- /* */
+ /**************************************************************************
+ *
+ * DELTACn[]: DELTA exceptions C1, C2, C3
+ * Opcode range: 0x73,0x74,0x75
+ * Stack: uint32 (2 * uint32)... -->
+ */
static void
Ins_DELTAC( TT_ExecContext exc,
FT_Long* args )
@@ -7305,27 +7360,27 @@
}
- /*************************************************************************/
- /* */
- /* MISC. INSTRUCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * MISC. INSTRUCTIONS
+ *
+ */
- /*************************************************************************/
- /* */
- /* GETINFO[]: GET INFOrmation */
- /* Opcode range: 0x88 */
- /* Stack: uint32 --> uint32 */
- /* */
- /* XXX: UNDOCUMENTED: Selector bits higher than 9 are currently (May */
- /* 2015) not documented in the OpenType specification. */
- /* */
- /* Selector bit 11 is incorrectly described as bit 8, while the */
- /* real meaning of bit 8 (vertical LCD subpixels) stays */
- /* undocumented. The same mistake can be found in Greg Hitchcock's */
- /* whitepaper. */
- /* */
+ /**************************************************************************
+ *
+ * GETINFO[]: GET INFOrmation
+ * Opcode range: 0x88
+ * Stack: uint32 --> uint32
+ *
+ * XXX: UNDOCUMENTED: Selector bits higher than 9 are currently (May
+ * 2015) not documented in the OpenType specification.
+ *
+ * Selector bit 11 is incorrectly described as bit 8, while the
+ * real meaning of bit 8 (vertical LCD subpixels) stays
+ * undocumented. The same mistake can be found in Greg Hitchcock's
+ * whitepaper.
+ */
static void
Ins_GETINFO( TT_ExecContext exc,
FT_Long* args )
@@ -7337,11 +7392,11 @@
K = 0;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- /********************************/
- /* RASTERIZER VERSION */
- /* Selector Bit: 0 */
- /* Return Bit(s): 0-7 */
- /* */
+ /*********************************
+ * RASTERIZER VERSION
+ * Selector Bit: 0
+ * Return Bit(s): 0-7
+ */
if ( SUBPIXEL_HINTING_INFINALITY &&
( args[0] & 1 ) != 0 &&
exc->subpixel_hinting )
@@ -7362,39 +7417,40 @@
if ( ( args[0] & 1 ) != 0 )
K = driver->interpreter_version;
- /********************************/
- /* GLYPH ROTATED */
- /* Selector Bit: 1 */
- /* Return Bit(s): 8 */
- /* */
+ /*********************************
+ * GLYPH ROTATED
+ * Selector Bit: 1
+ * Return Bit(s): 8
+ */
if ( ( args[0] & 2 ) != 0 && exc->tt_metrics.rotated )
K |= 1 << 8;
- /********************************/
- /* GLYPH STRETCHED */
- /* Selector Bit: 2 */
- /* Return Bit(s): 9 */
- /* */
+ /*********************************
+ * GLYPH STRETCHED
+ * Selector Bit: 2
+ * Return Bit(s): 9
+ */
if ( ( args[0] & 4 ) != 0 && exc->tt_metrics.stretched )
K |= 1 << 9;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /********************************/
- /* VARIATION GLYPH */
- /* Selector Bit: 3 */
- /* Return Bit(s): 10 */
- /* */
- /* XXX: UNDOCUMENTED! */
+ /*********************************
+ * VARIATION GLYPH
+ * Selector Bit: 3
+ * Return Bit(s): 10
+ *
+ * XXX: UNDOCUMENTED!
+ */
if ( (args[0] & 8 ) != 0 && exc->face->blend )
K |= 1 << 10;
#endif
- /********************************/
- /* BI-LEVEL HINTING AND */
- /* GRAYSCALE RENDERING */
- /* Selector Bit: 5 */
- /* Return Bit(s): 12 */
- /* */
+ /*********************************
+ * BI-LEVEL HINTING AND
+ * GRAYSCALE RENDERING
+ * Selector Bit: 5
+ * Return Bit(s): 12
+ */
if ( ( args[0] & 32 ) != 0 && exc->grayscale )
K |= 1 << 12;
@@ -7405,50 +7461,54 @@
/* Bold Italic'. */
if ( SUBPIXEL_HINTING_MINIMAL && exc->subpixel_hinting_lean )
{
- /********************************/
- /* HINTING FOR SUBPIXEL */
- /* Selector Bit: 6 */
- /* Return Bit(s): 13 */
- /* */
- /* v40 does subpixel hinting by default. */
+ /*********************************
+ * HINTING FOR SUBPIXEL
+ * Selector Bit: 6
+ * Return Bit(s): 13
+ *
+ * v40 does subpixel hinting by default.
+ */
if ( ( args[0] & 64 ) != 0 )
K |= 1 << 13;
- /********************************/
- /* VERTICAL LCD SUBPIXELS? */
- /* Selector Bit: 8 */
- /* Return Bit(s): 15 */
- /* */
+ /*********************************
+ * VERTICAL LCD SUBPIXELS?
+ * Selector Bit: 8
+ * Return Bit(s): 15
+ */
if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd_lean )
K |= 1 << 15;
- /********************************/
- /* SUBPIXEL POSITIONED? */
- /* Selector Bit: 10 */
- /* Return Bit(s): 17 */
- /* */
- /* XXX: FreeType supports it, dependent on what client does? */
+ /*********************************
+ * SUBPIXEL POSITIONED?
+ * Selector Bit: 10
+ * Return Bit(s): 17
+ *
+ * XXX: FreeType supports it, dependent on what client does?
+ */
if ( ( args[0] & 1024 ) != 0 )
K |= 1 << 17;
- /********************************/
- /* SYMMETRICAL SMOOTHING */
- /* Selector Bit: 11 */
- /* Return Bit(s): 18 */
- /* */
- /* The only smoothing method FreeType supports unless someone sets */
- /* FT_LOAD_TARGET_MONO. */
+ /*********************************
+ * SYMMETRICAL SMOOTHING
+ * Selector Bit: 11
+ * Return Bit(s): 18
+ *
+ * The only smoothing method FreeType supports unless someone sets
+ * FT_LOAD_TARGET_MONO.
+ */
if ( ( args[0] & 2048 ) != 0 && exc->subpixel_hinting_lean )
K |= 1 << 18;
- /********************************/
- /* CLEARTYPE HINTING AND */
- /* GRAYSCALE RENDERING */
- /* Selector Bit: 12 */
- /* Return Bit(s): 19 */
- /* */
- /* Grayscale rendering is what FreeType does anyway unless someone */
- /* sets FT_LOAD_TARGET_MONO or FT_LOAD_TARGET_LCD(_V) */
+ /*********************************
+ * CLEARTYPE HINTING AND
+ * GRAYSCALE RENDERING
+ * Selector Bit: 12
+ * Return Bit(s): 19
+ *
+ * Grayscale rendering is what FreeType does anyway unless someone
+ * sets FT_LOAD_TARGET_MONO or FT_LOAD_TARGET_LCD(_V)
+ */
if ( ( args[0] & 4096 ) != 0 && exc->grayscale_cleartype )
K |= 1 << 19;
}
@@ -7462,67 +7522,73 @@
if ( exc->rasterizer_version >= 37 )
{
- /********************************/
- /* HINTING FOR SUBPIXEL */
- /* Selector Bit: 6 */
- /* Return Bit(s): 13 */
- /* */
+ /*********************************
+ * HINTING FOR SUBPIXEL
+ * Selector Bit: 6
+ * Return Bit(s): 13
+ */
if ( ( args[0] & 64 ) != 0 && exc->subpixel_hinting )
K |= 1 << 13;
- /********************************/
- /* COMPATIBLE WIDTHS ENABLED */
- /* Selector Bit: 7 */
- /* Return Bit(s): 14 */
- /* */
- /* Functionality still needs to be added */
+ /*********************************
+ * COMPATIBLE WIDTHS ENABLED
+ * Selector Bit: 7
+ * Return Bit(s): 14
+ *
+ * Functionality still needs to be added
+ */
if ( ( args[0] & 128 ) != 0 && exc->compatible_widths )
K |= 1 << 14;
- /********************************/
- /* VERTICAL LCD SUBPIXELS? */
- /* Selector Bit: 8 */
- /* Return Bit(s): 15 */
- /* */
- /* Functionality still needs to be added */
+ /*********************************
+ * VERTICAL LCD SUBPIXELS?
+ * Selector Bit: 8
+ * Return Bit(s): 15
+ *
+ * Functionality still needs to be added
+ */
if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd )
K |= 1 << 15;
- /********************************/
- /* HINTING FOR BGR? */
- /* Selector Bit: 9 */
- /* Return Bit(s): 16 */
- /* */
- /* Functionality still needs to be added */
+ /*********************************
+ * HINTING FOR BGR?
+ * Selector Bit: 9
+ * Return Bit(s): 16
+ *
+ * Functionality still needs to be added
+ */
if ( ( args[0] & 512 ) != 0 && exc->bgr )
K |= 1 << 16;
if ( exc->rasterizer_version >= 38 )
{
- /********************************/
- /* SUBPIXEL POSITIONED? */
- /* Selector Bit: 10 */
- /* Return Bit(s): 17 */
- /* */
- /* Functionality still needs to be added */
+ /*********************************
+ * SUBPIXEL POSITIONED?
+ * Selector Bit: 10
+ * Return Bit(s): 17
+ *
+ * Functionality still needs to be added
+ */
if ( ( args[0] & 1024 ) != 0 && exc->subpixel_positioned )
K |= 1 << 17;
- /********************************/
- /* SYMMETRICAL SMOOTHING */
- /* Selector Bit: 11 */
- /* Return Bit(s): 18 */
- /* */
- /* Functionality still needs to be added */
+ /*********************************
+ * SYMMETRICAL SMOOTHING
+ * Selector Bit: 11
+ * Return Bit(s): 18
+ *
+ * Functionality still needs to be added
+ */
if ( ( args[0] & 2048 ) != 0 && exc->symmetrical_smoothing )
K |= 1 << 18;
- /********************************/
- /* GRAY CLEARTYPE */
- /* Selector Bit: 12 */
- /* Return Bit(s): 19 */
- /* */
- /* Functionality still needs to be added */
+ /*********************************
+ * GRAY CLEARTYPE
+ * Selector Bit: 12
+ * Return Bit(s): 19
+ *
+ * Functionality still needs to be added
+ */
if ( ( args[0] & 4096 ) != 0 && exc->gray_cleartype )
K |= 1 << 19;
}
@@ -7537,16 +7603,16 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /*************************************************************************/
- /* */
- /* GETVARIATION[]: get normalized variation (blend) coordinates */
- /* Opcode range: 0x91 */
- /* Stack: --> f2.14... */
- /* */
- /* XXX: UNDOCUMENTED! There is no official documentation from Apple for */
- /* this bytecode instruction. Active only if a font has GX */
- /* variation axes. */
- /* */
+ /**************************************************************************
+ *
+ * GETVARIATION[]: get normalized variation (blend) coordinates
+ * Opcode range: 0x91
+ * Stack: --> f2.14...
+ *
+ * XXX: UNDOCUMENTED! There is no official documentation from Apple for
+ * this bytecode instruction. Active only if a font has GX
+ * variation axes.
+ */
static void
Ins_GETVARIATION( TT_ExecContext exc,
FT_Long* args )
@@ -7576,15 +7642,15 @@
}
- /*************************************************************************/
- /* */
- /* GETDATA[]: no idea what this is good for */
- /* Opcode range: 0x92 */
- /* Stack: --> 17 */
- /* */
- /* XXX: UNDOCUMENTED! There is no documentation from Apple for this */
- /* very weird bytecode instruction. */
- /* */
+ /**************************************************************************
+ *
+ * GETDATA[]: no idea what this is good for
+ * Opcode range: 0x92
+ * Stack: --> 17
+ *
+ * XXX: UNDOCUMENTED! There is no documentation from Apple for this
+ * very weird bytecode instruction.
+ */
static void
Ins_GETDATA( FT_Long* args )
{
@@ -7632,34 +7698,34 @@
}
- /*************************************************************************/
- /* */
- /* RUN */
- /* */
- /* This function executes a run of opcodes. It will exit in the */
- /* following cases: */
- /* */
- /* - Errors (in which case it returns FALSE). */
- /* */
- /* - Reaching the end of the main code range (returns TRUE). */
- /* Reaching the end of a code range within a function call is an */
- /* error. */
- /* */
- /* - After executing one single opcode, if the flag `Instruction_Trap' */
- /* is set to TRUE (returns TRUE). */
- /* */
- /* On exit with TRUE, test IP < CodeSize to know whether it comes from */
- /* an instruction trap or a normal termination. */
- /* */
- /* */
- /* Note: The documented DEBUG opcode pops a value from the stack. This */
- /* behaviour is unsupported; here a DEBUG opcode is always an */
- /* error. */
- /* */
- /* */
- /* THIS IS THE INTERPRETER'S MAIN LOOP. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * RUN
+ *
+ * This function executes a run of opcodes. It will exit in the
+ * following cases:
+ *
+ * - Errors (in which case it returns FALSE).
+ *
+ * - Reaching the end of the main code range (returns TRUE).
+ * Reaching the end of a code range within a function call is an
+ * error.
+ *
+ * - After executing one single opcode, if the flag `Instruction_Trap'
+ * is set to TRUE (returns TRUE).
+ *
+ * On exit with TRUE, test IP < CodeSize to know whether it comes from
+ * an instruction trap or a normal termination.
+ *
+ *
+ * Note: The documented DEBUG opcode pops a value from the stack. This
+ * behaviour is unsupported; here a DEBUG opcode is always an
+ * error.
+ *
+ *
+ * THIS IS THE INTERPRETER'S MAIN LOOP.
+ *
+ */
/* documentation is in ttinterp.h */
@@ -7691,16 +7757,16 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/*
- * Toggle backward compatibility according to what font wants, except
- * when
+ * 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.
+ * 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.
+ * 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 &&
@@ -7801,7 +7867,7 @@
/* and the first few stack elements also */
FT_TRACE6(( " " ));
FT_TRACE7(( "%06d ", exc->IP ));
- FT_TRACE6(( opcode_name[exc->opcode] + 2 ));
+ FT_TRACE6(( "%s", opcode_name[exc->opcode] + 2 ));
FT_TRACE7(( "%*s", *opcode_name[exc->opcode] == 'A'
? 2
: 12 - ( *opcode_name[exc->opcode] - '0' ),
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.h
index 2966439ea25..0cb1e892fb8 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttinterp.h */
-/* */
-/* TrueType bytecode interpreter (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttinterp.h
+ *
+ * TrueType bytecode interpreter (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTINTERP_H_
@@ -26,10 +26,10 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* Rounding mode constants. */
- /* */
+ /**************************************************************************
+ *
+ * Rounding mode constants.
+ */
#define TT_Round_Off 5
#define TT_Round_To_Half_Grid 0
#define TT_Round_To_Grid 1
@@ -40,13 +40,13 @@ FT_BEGIN_HEADER
#define TT_Round_Super_45 7
- /*************************************************************************/
- /* */
- /* Function types used by the interpreter, depending on various modes */
- /* (e.g. the rounding mode, whether to render a vertical or horizontal */
- /* line etc). */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Function types used by the interpreter, depending on various modes
+ * (e.g. the rounding mode, whether to render a vertical or horizontal
+ * line etc).
+ *
+ */
/* Rounding function */
typedef FT_F26Dot6
@@ -84,10 +84,10 @@ FT_BEGIN_HEADER
FT_F26Dot6 value );
- /*************************************************************************/
- /* */
- /* This structure defines a call record, used to manage function calls. */
- /* */
+ /**************************************************************************
+ *
+ * This structure defines a call record, used to manage function calls.
+ */
typedef struct TT_CallRec_
{
FT_Int Caller_Range;
@@ -101,11 +101,11 @@ FT_BEGIN_HEADER
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- /*************************************************************************/
- /* */
- /* These structures define rules used to tweak subpixel hinting for */
- /* various fonts. "", 0, "", NULL value indicates to match any value. */
- /* */
+ /**************************************************************************
+ *
+ * These structures define rules used to tweak subpixel hinting for
+ * various fonts. "", 0, "", NULL value indicates to match any value.
+ */
#define SPH_MAX_NAME_SIZE 32
#define SPH_MAX_CLASS_MEMBERS 100
@@ -141,11 +141,11 @@ FT_BEGIN_HEADER
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
- /*************************************************************************/
- /* */
- /* The main structure for the interpreter which collects all necessary */
- /* variables and states. */
- /* */
+ /**************************************************************************
+ *
+ * The main structure for the interpreter which collects all necessary
+ * variables and states.
+ */
typedef struct TT_ExecContextRec_
{
TT_Face face;
@@ -352,7 +352,7 @@ FT_BEGIN_HEADER
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
*
* [3] Beat Stamm describes it in more detail:
- * http://www.beatstamm.com/typography/RTRCh4.htm#Sec12
+ * http://rastertragedy.com/RTRCh4.htm#Sec12.
*
* [4] The list of `native ClearType' fonts is small at the time of this
* writing; I found the following on a Windows 10 Update 1511
@@ -464,26 +464,27 @@ FT_BEGIN_HEADER
#endif /* TT_USE_BYTECODE_INTERPRETER */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_New_Context */
- /* */
- /* <Description> */
- /* Queries the face context for a given font. Note that there is */
- /* now a _single_ execution context in the TrueType driver which is */
- /* shared among faces. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* A handle to the execution context. Initialized for `face'. */
- /* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* (And right now only the glyph loader uses it.) */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_New_Context
+ *
+ * @Description:
+ * Queries the face context for a given font. Note that there is
+ * now a _single_ execution context in the TrueType driver which is
+ * shared among faces.
+ *
+ * @Input:
+ * face ::
+ * A handle to the source face object.
+ *
+ * @Return:
+ * A handle to the execution context. Initialized for `face'.
+ *
+ * @Note:
+ * Only the glyph loader and debugger should call this function.
+ * (And right now only the glyph loader uses it.)
+ */
FT_EXPORT( TT_ExecContext )
TT_New_Context( TT_Driver driver );
@@ -506,27 +507,28 @@ FT_BEGIN_HEADER
#endif /* TT_USE_BYTECODE_INTERPRETER */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_RunIns */
- /* */
- /* <Description> */
- /* Executes one or more instruction in the execution context. This */
- /* is the main function of the TrueType opcode interpreter. */
- /* */
- /* <Input> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only the object manager and debugger should call this function. */
- /* */
- /* This function is publicly exported because it is directly */
- /* invoked by the TrueType debugger. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_RunIns
+ *
+ * @Description:
+ * Executes one or more instruction in the execution context. This
+ * is the main function of the TrueType opcode interpreter.
+ *
+ * @Input:
+ * exec ::
+ * A handle to the target execution context.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * @Note:
+ * Only the object manager and debugger should call this function.
+ *
+ * This function is publicly exported because it is directly
+ * invoked by the TrueType debugger.
+ */
FT_EXPORT( FT_Error )
TT_RunIns( TT_ExecContext exec );
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.c
index 6685dc81960..f3a432cedd6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttobjs.c */
-/* */
-/* Objects manager (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttobjs.c
+ *
+ * Objects manager (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -36,36 +36,37 @@
#include "ttgxvar.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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttobjs
+#define FT_COMPONENT ttobjs
#ifdef TT_USE_BYTECODE_INTERPRETER
- /*************************************************************************/
- /* */
- /* GLYPH ZONE FUNCTIONS */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_glyphzone_done */
- /* */
- /* <Description> */
- /* Deallocate a glyph zone. */
- /* */
- /* <Input> */
- /* zone :: A pointer to the target glyph zone. */
- /* */
+ /**************************************************************************
+ *
+ * GLYPH ZONE FUNCTIONS
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_glyphzone_done
+ *
+ * @Description:
+ * Deallocate a glyph zone.
+ *
+ * @Input:
+ * zone ::
+ * A pointer to the target glyph zone.
+ */
FT_LOCAL_DEF( void )
tt_glyphzone_done( TT_GlyphZone zone )
{
@@ -87,27 +88,31 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_glyphzone_new */
- /* */
- /* <Description> */
- /* Allocate a new glyph zone. */
- /* */
- /* <Input> */
- /* memory :: A handle to the current memory object. */
- /* */
- /* maxPoints :: The capacity of glyph zone in points. */
- /* */
- /* maxContours :: The capacity of glyph zone in contours. */
- /* */
- /* <Output> */
- /* zone :: A pointer to the target glyph zone record. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_glyphzone_new
+ *
+ * @Description:
+ * Allocate a new glyph zone.
+ *
+ * @Input:
+ * memory ::
+ * A handle to the current memory object.
+ *
+ * maxPoints ::
+ * The capacity of glyph zone in points.
+ *
+ * maxContours ::
+ * The capacity of glyph zone in contours.
+ *
+ * @Output:
+ * zone ::
+ * A pointer to the target glyph zone record.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_glyphzone_new( FT_Memory memory,
FT_UShort maxPoints,
@@ -566,32 +571,37 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_init */
- /* */
- /* <Description> */
- /* Initialize a given TrueType face object. */
- /* */
- /* <Input> */
- /* stream :: The source font stream. */
- /* */
- /* face_index :: The index of the TrueType font, if we are opening a */
- /* collection, in bits 0-15. The numbered instance */
- /* index~+~1 of a GX (sub)font, if applicable, in bits */
- /* 16-30. */
- /* */
- /* num_params :: Number of additional generic parameters. Ignored. */
- /* */
- /* params :: Additional generic parameters. Ignored. */
- /* */
- /* <InOut> */
- /* face :: The newly built face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_init
+ *
+ * @Description:
+ * Initialize a given TrueType face object.
+ *
+ * @Input:
+ * stream ::
+ * The source font stream.
+ *
+ * face_index ::
+ * The index of the TrueType font, if we are opening a
+ * collection, in bits 0-15. The numbered instance
+ * index~+~1 of a GX (sub)font, if applicable, in bits
+ * 16-30.
+ *
+ * num_params ::
+ * Number of additional generic parameters. Ignored.
+ *
+ * params ::
+ * Additional generic parameters. Ignored.
+ *
+ * @InOut:
+ * face ::
+ * The newly built face object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
@@ -743,17 +753,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_done */
- /* */
- /* <Description> */
- /* Finalize a given face object. */
- /* */
- /* <Input> */
- /* face :: A pointer to the face object to destroy. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_done
+ *
+ * @Description:
+ * Finalize a given face object.
+ *
+ * @Input:
+ * face ::
+ * A pointer to the face object to destroy.
+ */
FT_LOCAL_DEF( void )
tt_face_done( FT_Face ttface ) /* TT_Face */
{
@@ -799,30 +810,32 @@
}
- /*************************************************************************/
- /* */
- /* SIZE FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SIZE FUNCTIONS
+ *
+ */
#ifdef TT_USE_BYTECODE_INTERPRETER
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_size_run_fpgm */
- /* */
- /* <Description> */
- /* Run the font program. */
- /* */
- /* <Input> */
- /* size :: A handle to the size object. */
- /* */
- /* pedantic :: Set if bytecode execution should be pedantic. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_size_run_fpgm
+ *
+ * @Description:
+ * Run the font program.
+ *
+ * @Input:
+ * size ::
+ * A handle to the size object.
+ *
+ * pedantic ::
+ * Set if bytecode execution should be pedantic.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_size_run_fpgm( TT_Size size,
FT_Bool pedantic )
@@ -899,22 +912,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_size_run_prep */
- /* */
- /* <Description> */
- /* Run the control value program. */
- /* */
- /* <Input> */
- /* size :: A handle to the size object. */
- /* */
- /* pedantic :: Set if bytecode execution should be pedantic. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_size_run_prep
+ *
+ * @Description:
+ * Run the control value program.
+ *
+ * @Input:
+ * size ::
+ * A handle to the size object.
+ *
+ * pedantic ::
+ * Set if bytecode execution should be pedantic.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_size_run_prep( TT_Size size,
FT_Bool pedantic )
@@ -1159,10 +1174,16 @@
TT_Face face = (TT_Face)size->root.face;
- /* Scale the cvt values to the new ppem. */
- /* We use by default the y ppem to scale the CVT. */
+ /* Scale the cvt values to the new ppem. */
+ /* By default, we use the y ppem value for scaling. */
+ FT_TRACE6(( "CVT values:\n" ));
for ( i = 0; i < size->cvt_size; i++ )
+ {
size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
+ FT_TRACE6(( " %3d: %d (%f)\n",
+ i, face->cvt[i], size->cvt[i] / 64.0 ));
+ }
+ FT_TRACE6(( "\n" ));
/* all twilight points are originally zero */
for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ )
@@ -1191,20 +1212,21 @@
#endif /* TT_USE_BYTECODE_INTERPRETER */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_size_init */
- /* */
- /* <Description> */
- /* Initialize a new TrueType size object. */
- /* */
- /* <InOut> */
- /* size :: A handle to the size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_size_init
+ *
+ * @Description:
+ * Initialize a new TrueType size object.
+ *
+ * @InOut:
+ * size ::
+ * A handle to the size object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_size_init( FT_Size ttsize ) /* TT_Size */
{
@@ -1224,17 +1246,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_size_done */
- /* */
- /* <Description> */
- /* The TrueType size object finalizer. */
- /* */
- /* <Input> */
- /* size :: A handle to the target size object. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_size_done
+ *
+ * @Description:
+ * The TrueType size object finalizer.
+ *
+ * @Input:
+ * size ::
+ * A handle to the target size object.
+ */
FT_LOCAL_DEF( void )
tt_size_done( FT_Size ttsize ) /* TT_Size */
{
@@ -1249,22 +1272,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_size_reset */
- /* */
- /* <Description> */
- /* Reset a TrueType size when resolutions and character dimensions */
- /* have been changed. */
- /* */
- /* <Input> */
- /* size :: A handle to the target size object. */
- /* */
- /* only_height :: Only recompute ascender, descender, and height; */
- /* this flag is used for variation fonts where */
- /* `tt_size_reset' is used as an iterator function. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_size_reset
+ *
+ * @Description:
+ * Reset a TrueType size when resolutions and character dimensions
+ * have been changed.
+ *
+ * @Input:
+ * size ::
+ * A handle to the target size object.
+ *
+ * only_height ::
+ * Only recompute ascender, descender, and height;
+ * this flag is used for variation fonts where
+ * `tt_size_reset' is used as an iterator function.
+ */
FT_LOCAL_DEF( FT_Error )
tt_size_reset( TT_Size size,
FT_Bool only_height )
@@ -1358,20 +1383,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_driver_init */
- /* */
- /* <Description> */
- /* Initialize a given TrueType driver object. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target driver object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_driver_init
+ *
+ * @Description:
+ * Initialize a given TrueType driver object.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target driver object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_driver_init( FT_Module ttdriver ) /* TT_Driver */
{
@@ -1398,17 +1424,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_driver_done */
- /* */
- /* <Description> */
- /* Finalize a given TrueType driver. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target TrueType driver. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_driver_done
+ *
+ * @Description:
+ * Finalize a given TrueType driver.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target TrueType driver.
+ */
FT_LOCAL_DEF( void )
tt_driver_done( FT_Module ttdriver ) /* TT_Driver */
{
@@ -1416,20 +1443,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_slot_init */
- /* */
- /* <Description> */
- /* Initialize a new slot object. */
- /* */
- /* <InOut> */
- /* slot :: A handle to the slot object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_slot_init
+ *
+ * @Description:
+ * Initialize a new slot object.
+ *
+ * @InOut:
+ * slot ::
+ * A handle to the slot object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_slot_init( FT_GlyphSlot slot )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.h
index 38fa30e4e9f..9fc654d5d10 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttobjs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttobjs.h */
-/* */
-/* Objects manager (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttobjs.h
+ *
+ * Objects manager (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTOBJS_H_
@@ -28,40 +28,40 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Driver */
- /* */
- /* <Description> */
- /* A handle to a TrueType driver object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * TT_Driver
+ *
+ * @Description:
+ * A handle to a TrueType driver object.
+ */
typedef struct TT_DriverRec_* TT_Driver;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a TrueType glyph slot object. */
- /* */
- /* <Note> */
- /* This is a direct typedef of FT_GlyphSlot, as there is nothing */
- /* specific about the TrueType glyph slot. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * TT_GlyphSlot
+ *
+ * @Description:
+ * A handle to a TrueType glyph slot object.
+ *
+ * @Note:
+ * This is a direct typedef of FT_GlyphSlot, as there is nothing
+ * specific about the TrueType glyph slot.
+ */
typedef FT_GlyphSlot TT_GlyphSlot;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_GraphicsState */
- /* */
- /* <Description> */
- /* The TrueType graphics state used during bytecode interpretation. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * TT_GraphicsState
+ *
+ * @Description:
+ * The TrueType graphics state used during bytecode interpretation.
+ */
typedef struct TT_GraphicsState_
{
FT_UShort rp0;
@@ -113,25 +113,25 @@ FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* EXECUTION SUBTABLES */
- /* */
- /* These sub-tables relate to instruction execution. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * EXECUTION SUBTABLES
+ *
+ * These sub-tables relate to instruction execution.
+ *
+ */
#define TT_MAX_CODE_RANGES 3
- /*************************************************************************/
- /* */
- /* There can only be 3 active code ranges at once: */
- /* - the Font Program */
- /* - the CVT Program */
- /* - a glyph's instructions set */
- /* */
+ /**************************************************************************
+ *
+ * There can only be 3 active code ranges at once:
+ * - the Font Program
+ * - the CVT Program
+ * - a glyph's instructions set
+ */
typedef enum TT_CodeRange_Tag_
{
tt_coderange_none = 0,
@@ -152,10 +152,10 @@ FT_BEGIN_HEADER
typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
- /*************************************************************************/
- /* */
- /* Defines a function/instruction definition record. */
- /* */
+ /**************************************************************************
+ *
+ * Defines a function/instruction definition record.
+ */
typedef struct TT_DefRecord_
{
FT_Int range; /* in which code range is it located? */
@@ -169,10 +169,10 @@ FT_BEGIN_HEADER
} TT_DefRecord, *TT_DefArray;
- /*************************************************************************/
- /* */
- /* Subglyph transformation record. */
- /* */
+ /**************************************************************************
+ *
+ * Subglyph transformation record.
+ */
typedef struct TT_Transform_
{
FT_Fixed xx, xy; /* transformation matrix coefficients */
@@ -182,72 +182,72 @@ FT_BEGIN_HEADER
} TT_Transform;
- /*************************************************************************/
- /* */
- /* A note regarding non-squared pixels: */
- /* */
- /* (This text will probably go into some docs at some time; for now, it */
- /* is kept here to explain some definitions in the TT_Size_Metrics */
- /* record). */
- /* */
- /* The CVT is a one-dimensional array containing values that control */
- /* certain important characteristics in a font, like the height of all */
- /* capitals, all lowercase letter, default spacing or stem width/height. */
- /* */
- /* These values are found in FUnits in the font file, and must be scaled */
- /* to pixel coordinates before being used by the CVT and glyph programs. */
- /* Unfortunately, when using distinct x and y resolutions (or distinct x */
- /* and y pointsizes), there are two possible scalings. */
- /* */
- /* A first try was to implement a `lazy' scheme where all values were */
- /* scaled when first used. However, while some values are always used */
- /* in the same direction, some others are used under many different */
- /* circumstances and orientations. */
- /* */
- /* I have found a simpler way to do the same, and it even seems to work */
- /* in most of the cases: */
- /* */
- /* - All CVT values are scaled to the maximum ppem size. */
- /* */
- /* - When performing a read or write in the CVT, a ratio factor is used */
- /* to perform adequate scaling. Example: */
- /* */
- /* x_ppem = 14 */
- /* y_ppem = 10 */
- /* */
- /* We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */
- /* entries are scaled to it. */
- /* */
- /* x_ratio = 1.0 */
- /* y_ratio = y_ppem/ppem (< 1.0) */
- /* */
- /* We compute the current ratio like: */
- /* */
- /* - If projVector is horizontal, */
- /* ratio = x_ratio = 1.0 */
- /* */
- /* - if projVector is vertical, */
- /* ratio = y_ratio */
- /* */
- /* - else, */
- /* ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */
- /* */
- /* Reading a cvt value returns */
- /* ratio * cvt[index] */
- /* */
- /* Writing a cvt value in pixels: */
- /* cvt[index] / ratio */
- /* */
- /* The current ppem is simply */
- /* ratio * ppem */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Metrics used by the TrueType size and context objects. */
- /* */
+ /**************************************************************************
+ *
+ * A note regarding non-squared pixels:
+ *
+ * (This text will probably go into some docs at some time; for now, it
+ * is kept here to explain some definitions in the TT_Size_Metrics
+ * record).
+ *
+ * The CVT is a one-dimensional array containing values that control
+ * certain important characteristics in a font, like the height of all
+ * capitals, all lowercase letter, default spacing or stem width/height.
+ *
+ * These values are found in FUnits in the font file, and must be scaled
+ * to pixel coordinates before being used by the CVT and glyph programs.
+ * Unfortunately, when using distinct x and y resolutions (or distinct x
+ * and y pointsizes), there are two possible scalings.
+ *
+ * A first try was to implement a `lazy' scheme where all values were
+ * scaled when first used. However, while some values are always used
+ * in the same direction, some others are used under many different
+ * circumstances and orientations.
+ *
+ * I have found a simpler way to do the same, and it even seems to work
+ * in most of the cases:
+ *
+ * - All CVT values are scaled to the maximum ppem size.
+ *
+ * - When performing a read or write in the CVT, a ratio factor is used
+ * to perform adequate scaling. Example:
+ *
+ * x_ppem = 14
+ * y_ppem = 10
+ *
+ * We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt
+ * entries are scaled to it.
+ *
+ * x_ratio = 1.0
+ * y_ratio = y_ppem/ppem (< 1.0)
+ *
+ * We compute the current ratio like:
+ *
+ * - If projVector is horizontal,
+ * ratio = x_ratio = 1.0
+ *
+ * - if projVector is vertical,
+ * ratio = y_ratio
+ *
+ * - else,
+ * ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 )
+ *
+ * Reading a cvt value returns
+ * ratio * cvt[index]
+ *
+ * Writing a cvt value in pixels:
+ * cvt[index] / ratio
+ *
+ * The current ppem is simply
+ * ratio * ppem
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * Metrics used by the TrueType size and context objects.
+ */
typedef struct TT_Size_Metrics_
{
/* for non-square pixels */
@@ -268,10 +268,10 @@ FT_BEGIN_HEADER
} TT_Size_Metrics;
- /*************************************************************************/
- /* */
- /* TrueType size class. */
- /* */
+ /**************************************************************************
+ *
+ * TrueType size class.
+ */
typedef struct TT_SizeRec_
{
FT_SizeRec root;
@@ -324,10 +324,10 @@ FT_BEGIN_HEADER
} TT_SizeRec;
- /*************************************************************************/
- /* */
- /* TrueType driver class. */
- /* */
+ /**************************************************************************
+ *
+ * TrueType driver class.
+ */
typedef struct TT_DriverRec_
{
FT_DriverRec root;
@@ -348,10 +348,10 @@ FT_BEGIN_HEADER
/* will always use the TT driver to create them. */
- /*************************************************************************/
- /* */
- /* Face functions */
- /* */
+ /**************************************************************************
+ *
+ * Face functions
+ */
FT_LOCAL( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
@@ -363,10 +363,10 @@ FT_BEGIN_HEADER
tt_face_done( FT_Face ttface ); /* TT_Face */
- /*************************************************************************/
- /* */
- /* Size functions */
- /* */
+ /**************************************************************************
+ *
+ * Size functions
+ */
FT_LOCAL( FT_Error )
tt_size_init( FT_Size ttsize ); /* TT_Size */
@@ -394,10 +394,10 @@ FT_BEGIN_HEADER
FT_Bool only_height );
- /*************************************************************************/
- /* */
- /* Driver functions */
- /* */
+ /**************************************************************************
+ *
+ * Driver functions
+ */
FT_LOCAL( FT_Error )
tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
@@ -405,10 +405,10 @@ FT_BEGIN_HEADER
tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
- /*************************************************************************/
- /* */
- /* Slot functions */
- /* */
+ /**************************************************************************
+ *
+ * Slot functions
+ */
FT_LOCAL( FT_Error )
tt_slot_init( FT_GlyphSlot slot );
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.c
deleted file mode 100644
index cdbb80639e1..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************/
-/* */
-/* ttpic.c */
-/* */
-/* The FreeType position independent code services for truetype module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_INTERNAL_OBJECTS_H
-#include "ttpic.h"
-#include "tterrors.h"
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /* forward declaration of PIC init functions from ttdriver.c */
- FT_Error
- FT_Create_Class_tt_services( FT_Library library,
- FT_ServiceDescRec** output_class );
- void
- FT_Destroy_Class_tt_services( FT_Library library,
- FT_ServiceDescRec* clazz );
- void
- FT_Init_Class_tt_service_gx_multi_masters(
- FT_Service_MultiMastersRec* sv_mm );
- void
- FT_Init_Class_tt_service_truetype_glyf(
- FT_Service_TTGlyfRec* sv_ttglyf );
-
-
- void
- tt_driver_class_pic_free( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
-
-
- if ( pic_container->truetype )
- {
- TTModulePIC* container = (TTModulePIC*)pic_container->truetype;
-
-
- if ( container->tt_services )
- FT_Destroy_Class_tt_services( library, container->tt_services );
- container->tt_services = NULL;
- FT_FREE( container );
- pic_container->truetype = NULL;
- }
- }
-
-
- FT_Error
- tt_driver_class_pic_init( FT_Library library )
- {
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Error error = FT_Err_Ok;
- TTModulePIC* container = NULL;
- FT_Memory memory = library->memory;
-
-
- /* allocate pointer, clear and set global container pointer */
- if ( FT_ALLOC( container, sizeof ( *container ) ) )
- return error;
- FT_MEM_SET( container, 0, sizeof ( *container ) );
- pic_container->truetype = container;
-
- /* initialize pointer table - this is how the module usually */
- /* expects this data */
- error = FT_Create_Class_tt_services( library,
- &container->tt_services );
- if ( error )
- goto Exit;
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Init_Class_tt_service_gx_multi_masters(
- &container->tt_service_gx_multi_masters );
-#endif
- FT_Init_Class_tt_service_truetype_glyf(
- &container->tt_service_truetype_glyf );
-
- Exit:
- if ( error )
- tt_driver_class_pic_free( library );
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.h
deleted file mode 100644
index df878ae6f1d..00000000000
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpic.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************/
-/* */
-/* ttpic.h */
-/* */
-/* The FreeType position independent code services for truetype module. */
-/* */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* 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 TTPIC_H_
-#define TTPIC_H_
-
-
-#include FT_INTERNAL_PIC_H
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define TT_SERVICES_GET tt_services
-#define TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters
-#define TT_SERVICE_METRICS_VARIATIONS_GET tt_service_metrics_variations
-#define TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf
-#define TT_SERVICE_PROPERTIES_GET tt_service_properties
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#include FT_MULTIPLE_MASTERS_H
-#include FT_SERVICE_MULTIPLE_MASTERS_H
-#include FT_SERVICE_METRICS_VARIATIONS_H
-#include FT_SERVICE_TRUETYPE_GLYF_H
-#include FT_SERVICE_PROPERTIES_H
-
-
-FT_BEGIN_HEADER
-
- typedef struct TTModulePIC_
- {
- FT_ServiceDescRec* tt_services;
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Service_MultiMastersRec tt_service_gx_multi_masters;
- FT_Service_MetricsVariationsRec tt_service_metrics_variations;
-#endif
- FT_Service_TTGlyfRec tt_service_truetype_glyf;
- FT_Service_PropertiesRec tt_service_properties;
-
- } TTModulePIC;
-
-
-#define GET_PIC( lib ) \
- ( (TTModulePIC*)((lib)->pic_container.truetype) )
-#define TT_SERVICES_GET \
- ( GET_PIC( library )->tt_services )
-#define TT_SERVICE_METRICS_VARIATIONS_GET \
- ( GET_PIC( library )->tt_service_metrics_variations )
-#define TT_SERVICE_GX_MULTI_MASTERS_GET \
- ( GET_PIC( library )->tt_service_gx_multi_masters )
-#define TT_SERVICE_TRUETYPE_GLYF_GET \
- ( GET_PIC( library )->tt_service_truetype_glyf )
-#define TT_SERVICE_PROPERTIES_GET \
- ( GET_PIC( library )->tt_service_properties )
-
-
- /* see ttpic.c for the implementation */
- void
- tt_driver_class_pic_free( FT_Library library );
-
- FT_Error
- tt_driver_class_pic_init( FT_Library library );
-
-FT_END_HEADER
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-#endif /* TTPIC_H_ */
-
-
-/* END */
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.c
index d9526ad082b..e7718bf9b79 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttpload.c */
-/* */
-/* TrueType-specific tables loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttpload.c
+ *
+ * TrueType-specific tables loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -31,33 +31,35 @@
#include "tterrors.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_ttpload
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_loca */
- /* */
- /* <Description> */
- /* Load the locations table. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+#define FT_COMPONENT ttpload
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_loca
+ *
+ * @Description:
+ * Load the locations table.
+ *
+ * @InOut:
+ * face ::
+ * A handle to the target face object.
+ *
+ * @Input:
+ * stream ::
+ * The input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_loca( TT_Face face,
FT_Stream stream )
@@ -297,23 +299,25 @@
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_cvt */
- /* */
- /* <Description> */
- /* Load the control value table into a face object. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_cvt
+ *
+ * @Description:
+ * Load the control value table into a face object.
+ *
+ * @InOut:
+ * face ::
+ * A handle to the target face object.
+ *
+ * @Input:
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_cvt( TT_Face face,
FT_Stream stream )
@@ -378,23 +382,25 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_fpgm */
- /* */
- /* <Description> */
- /* Load the font program. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_fpgm
+ *
+ * @Description:
+ * Load the font program.
+ *
+ * @InOut:
+ * face ::
+ * A handle to the target face object.
+ *
+ * @Input:
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_fpgm( TT_Face face,
FT_Stream stream )
@@ -440,23 +446,25 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_prep */
- /* */
- /* <Description> */
- /* Load the cvt program. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_prep
+ *
+ * @Description:
+ * Load the cvt program.
+ *
+ * @InOut:
+ * face ::
+ * A handle to the target face object.
+ *
+ * @Input:
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_prep( TT_Face face,
FT_Stream stream )
@@ -501,22 +509,24 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_load_hdmx */
- /* */
- /* <Description> */
- /* Load the `hdmx' table into the face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: A handle to the input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * tt_face_load_hdmx
+ *
+ * @Description:
+ * Load the `hdmx' table into the face object.
+ *
+ * @Input:
+ * face ::
+ * A handle to the target face object.
+ *
+ * stream ::
+ * A handle to the input stream.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
tt_face_load_hdmx( TT_Face face,
@@ -610,11 +620,11 @@
}
- /*************************************************************************/
- /* */
- /* Return the advance width table for a given pixel size if it is found */
- /* in the font's `hdmx' table (if any). */
- /* */
+ /**************************************************************************
+ *
+ * Return the advance width table for a given pixel size if it is found
+ * in the font's `hdmx' table (if any).
+ */
FT_LOCAL_DEF( FT_Byte* )
tt_face_get_device_metrics( TT_Face face,
FT_UInt ppem,
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.h
index fa125272472..022750e3246 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttpload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttpload.h */
-/* */
-/* TrueType-specific tables loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttpload.h
+ *
+ * TrueType-specific tables loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 TTPLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.c
index d94bcc8b50d..23a2e5b4401 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.c
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttsubpix.c */
-/* */
-/* TrueType Subpixel Hinting. */
-/* */
-/* Copyright 2010-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttsubpix.c
+ *
+ * TrueType Subpixel Hinting.
+ *
+ * Copyright (C) 2010-2019 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 <ft2build.h>
#include FT_INTERNAL_DEBUG_H
@@ -30,35 +30,35 @@
#if defined( TT_USE_BYTECODE_INTERPRETER ) && \
defined( TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY )
- /*************************************************************************/
- /* */
- /* These rules affect how the TT Interpreter does hinting, with the */
- /* goal of doing subpixel hinting by (in general) ignoring x moves. */
- /* Some of these rules are fixes that go above and beyond the */
- /* stated techniques in the MS whitepaper on Cleartype, due to */
- /* artifacts in many glyphs. So, these rules make some glyphs render */
- /* better than they do in the MS rasterizer. */
- /* */
- /* "" string or 0 int/char indicates to apply to all glyphs. */
- /* "-" used as dummy placeholders, but any non-matching string works. */
- /* */
- /* Some of this could arguably be implemented in fontconfig, however: */
- /* */
- /* - Fontconfig can't set things on a glyph-by-glyph basis. */
- /* - The tweaks that happen here are very low-level, from an average */
- /* user's point of view and are best implemented in the hinter. */
- /* */
- /* The goal is to make the subpixel hinting techniques as generalized */
- /* as possible across all fonts to prevent the need for extra rules such */
- /* as these. */
- /* */
- /* The rule structure is designed so that entirely new rules can easily */
- /* be added when a new compatibility feature is discovered. */
- /* */
- /* The rule structures could also use some enhancement to handle ranges. */
- /* */
- /* ****************** WORK IN PROGRESS ******************* */
- /* */
+ /**************************************************************************
+ *
+ * These rules affect how the TT Interpreter does hinting, with the
+ * goal of doing subpixel hinting by (in general) ignoring x moves.
+ * Some of these rules are fixes that go above and beyond the
+ * stated techniques in the MS whitepaper on Cleartype, due to
+ * artifacts in many glyphs. So, these rules make some glyphs render
+ * better than they do in the MS rasterizer.
+ *
+ * "" string or 0 int/char indicates to apply to all glyphs.
+ * "-" used as dummy placeholders, but any non-matching string works.
+ *
+ * Some of this could arguably be implemented in fontconfig, however:
+ *
+ * - Fontconfig can't set things on a glyph-by-glyph basis.
+ * - The tweaks that happen here are very low-level, from an average
+ * user's point of view and are best implemented in the hinter.
+ *
+ * The goal is to make the subpixel hinting techniques as generalized
+ * as possible across all fonts to prevent the need for extra rules such
+ * as these.
+ *
+ * The rule structure is designed so that entirely new rules can easily
+ * be added when a new compatibility feature is discovered.
+ *
+ * The rule structures could also use some enhancement to handle ranges.
+ *
+ * ****************** WORK IN PROGRESS *******************
+ */
/* These are `classes' of fonts that can be grouped together and used in */
/* rules below. A blank entry "" is required at the end of these! */
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.h b/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.h
index 1070bb016fd..4966800c2d7 100644
--- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.h
+++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttsubpix.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ttsubpix.h */
-/* */
-/* TrueType Subpixel Hinting. */
-/* */
-/* Copyright 2010-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttsubpix.h
+ *
+ * TrueType Subpixel Hinting.
+ *
+ * Copyright (C) 2010-2019 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 TTSUBPIX_H_
@@ -29,11 +29,11 @@ FT_BEGIN_HEADER
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- /*************************************************************************/
- /* */
- /* ID flags to identify special functions at FDEF and runtime. */
- /* */
- /* */
+ /**************************************************************************
+ *
+ * ID flags to identify special functions at FDEF and runtime.
+ *
+ */
#define SPH_FDEF_INLINE_DELTA_1 0x0000001
#define SPH_FDEF_INLINE_DELTA_2 0x0000002
#define SPH_FDEF_DIAGONAL_STROKE 0x0000004
@@ -45,11 +45,11 @@ FT_BEGIN_HEADER
#define SPH_FDEF_TYPEMAN_DIAGENDCTRL 0x0000100
- /*************************************************************************/
- /* */
- /* Tweak flags that are set for each glyph by the below rules. */
- /* */
- /* */
+ /**************************************************************************
+ *
+ * Tweak flags that are set for each glyph by the below rules.
+ *
+ */
#define SPH_TWEAK_ALLOW_X_DMOVE 0x0000001UL
#define SPH_TWEAK_ALWAYS_DO_DELTAP 0x0000002UL
#define SPH_TWEAK_ALWAYS_SKIP_DELTAP 0x0000004UL
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/Jamfile b/Build/source/libs/freetype2/freetype-src/src/type1/Jamfile
index b94b7d0aae9..0bcfb2e406e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/type1 Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/type1/module.mk b/Build/source/libs/freetype2/freetype-src/src/type1/module.mk
index 3fea5cc16fe..2f48c658217 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/type1/rules.mk b/Build/source/libs/freetype2/freetype-src/src/type1/rules.mk
index cb1a1428609..901169c7a52 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c
index 61053d9a640..6841184539f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1afm.c */
-/* */
-/* AFM support for Type 1 fonts (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1afm.c
+ *
+ * AFM support for Type 1 fonts (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -26,14 +26,14 @@
#ifndef T1_CONFIG_OPTION_NO_AFM
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1afm
+#define FT_COMPONENT t1afm
FT_LOCAL_DEF( void )
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.h
index cb8d302b4d4..a8e6a5495a2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1afm.h */
-/* */
-/* AFM support for Type 1 fonts (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1afm.h
+ *
+ * AFM support for Type 1 fonts (specification).
+ *
+ * Copyright (C) 1996-2019 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 T1AFM_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c
index 029b410b476..8625db5b015 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1driver.c */
-/* */
-/* Type 1 driver interface (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1driver.c
+ *
+ * Type 1 driver interface (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -43,19 +43,19 @@
#include FT_SERVICE_KERNING_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1driver
+#define FT_COMPONENT t1driver
- /*
- * GLYPH DICT SERVICE
- *
- */
+ /*
+ * GLYPH DICT SERVICE
+ *
+ */
static FT_Error
t1_get_glyph_name( T1_Face face,
@@ -97,7 +97,7 @@
/*
- * POSTSCRIPT NAME SERVICE
+ * POSTSCRIPT NAME SERVICE
*
*/
@@ -115,30 +115,32 @@
/*
- * MULTIPLE MASTERS SERVICE
+ * MULTIPLE MASTERS SERVICE
*
*/
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
static const FT_Service_MultiMastersRec t1_service_multi_masters =
{
- (FT_Get_MM_Func) T1_Get_Multi_Master, /* get_mm */
- (FT_Set_MM_Design_Func) T1_Set_MM_Design, /* set_mm_design */
- (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */
- (FT_Get_MM_Blend_Func) T1_Get_MM_Blend, /* get_mm_blend */
- (FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */
- (FT_Get_Var_Design_Func)T1_Get_Var_Design, /* get_var_design */
- (FT_Set_Instance_Func) T1_Reset_MM_Blend, /* set_instance */
-
- (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */
- (FT_Done_Blend_Func) T1_Done_Blend /* done_blend */
+ (FT_Get_MM_Func) T1_Get_Multi_Master, /* get_mm */
+ (FT_Set_MM_Design_Func) T1_Set_MM_Design, /* set_mm_design */
+ (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) T1_Get_MM_Blend, /* get_mm_blend */
+ (FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */
+ (FT_Set_Var_Design_Func) T1_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func) T1_Get_Var_Design, /* get_var_design */
+ (FT_Set_Instance_Func) T1_Reset_MM_Blend, /* set_instance */
+ (FT_Set_MM_WeightVector_Func)T1_Set_MM_WeightVector, /* set_mm_weightvector */
+ (FT_Get_MM_WeightVector_Func)T1_Get_MM_WeightVector, /* get_mm_weightvector */
+
+ (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */
+ (FT_Done_Blend_Func) T1_Done_Blend /* done_blend */
};
#endif
/*
- * POSTSCRIPT INFO SERVICE
+ * POSTSCRIPT INFO SERVICE
*
*/
@@ -270,9 +272,12 @@
break;
case PS_DICT_FONT_NAME:
- retval = ft_strlen( type1->font_name ) + 1;
- if ( value && value_len >= retval )
- ft_memcpy( value, (void *)( type1->font_name ), retval );
+ if ( type1->font_name )
+ {
+ retval = ft_strlen( type1->font_name ) + 1;
+ if ( value && value_len >= retval )
+ ft_memcpy( value, (void *)( type1->font_name ), retval );
+ }
break;
case PS_DICT_UNIQUE_ID:
@@ -362,7 +367,7 @@
ok = 1;
}
- if ( ok )
+ if ( ok && type1->subrs )
{
retval = type1->subrs_len[idx] + 1;
if ( value && value_len >= retval )
@@ -559,33 +564,49 @@
break;
case PS_DICT_VERSION:
- retval = ft_strlen( type1->font_info.version ) + 1;
- if ( value && value_len >= retval )
- ft_memcpy( value, (void *)( type1->font_info.version ), retval );
+ if ( type1->font_info.version )
+ {
+ retval = ft_strlen( type1->font_info.version ) + 1;
+ if ( value && value_len >= retval )
+ ft_memcpy( value, (void *)( type1->font_info.version ), retval );
+ }
break;
case PS_DICT_NOTICE:
- retval = ft_strlen( type1->font_info.notice ) + 1;
- if ( value && value_len >= retval )
- ft_memcpy( value, (void *)( type1->font_info.notice ), retval );
+ if ( type1->font_info.notice )
+ {
+ retval = ft_strlen( type1->font_info.notice ) + 1;
+ if ( value && value_len >= retval )
+ ft_memcpy( value, (void *)( type1->font_info.notice ), retval );
+ }
break;
case PS_DICT_FULL_NAME:
- retval = ft_strlen( type1->font_info.full_name ) + 1;
- if ( value && value_len >= retval )
- ft_memcpy( value, (void *)( type1->font_info.full_name ), retval );
+ if ( type1->font_info.full_name )
+ {
+ retval = ft_strlen( type1->font_info.full_name ) + 1;
+ if ( value && value_len >= retval )
+ ft_memcpy( value, (void *)( type1->font_info.full_name ), retval );
+ }
break;
case PS_DICT_FAMILY_NAME:
- retval = ft_strlen( type1->font_info.family_name ) + 1;
- if ( value && value_len >= retval )
- ft_memcpy( value, (void *)( type1->font_info.family_name ), retval );
+ if ( type1->font_info.family_name )
+ {
+ retval = ft_strlen( type1->font_info.family_name ) + 1;
+ if ( value && value_len >= retval )
+ ft_memcpy( value, (void *)( type1->font_info.family_name ),
+ retval );
+ }
break;
case PS_DICT_WEIGHT:
- retval = ft_strlen( type1->font_info.weight ) + 1;
- if ( value && value_len >= retval )
- ft_memcpy( value, (void *)( type1->font_info.weight ), retval );
+ if ( type1->font_info.weight )
+ {
+ retval = ft_strlen( type1->font_info.weight ) + 1;
+ if ( value && value_len >= retval )
+ ft_memcpy( value, (void *)( type1->font_info.weight ), retval );
+ }
break;
case PS_DICT_ITALIC_ANGLE:
@@ -618,7 +639,7 @@
/*
- * PROPERTY SERVICE
+ * PROPERTY SERVICE
*
*/
@@ -630,7 +651,7 @@
/*
- * SERVICE LIST
+ * SERVICE LIST
*
*/
@@ -665,38 +686,42 @@
#ifndef T1_CONFIG_OPTION_NO_AFM
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Get_Kerning */
- /* */
- /* <Description> */
- /* A driver method used to return the kerning vector between two */
- /* glyphs of the same face. */
- /* */
- /* <Input> */
- /* face :: A handle to the 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. */
- /* */
- /* <Output> */
- /* kerning :: The kerning vector. This is in font units for */
- /* scalable formats, and in pixels for fixed-sizes */
- /* formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this function. Other layouts, or more sophisticated */
- /* kernings are out of scope of this method (the basic driver */
- /* interface is meant to be simple). */
- /* */
- /* They can be implemented by format-specific interfaces. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * Get_Kerning
+ *
+ * @Description:
+ * A driver method used to return the kerning vector between two
+ * glyphs of the same face.
+ *
+ * @Input:
+ * face ::
+ * A handle to the 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.
+ *
+ * @Output:
+ * kerning ::
+ * The kerning vector. This is in font units for
+ * scalable formats, and in pixels for fixed-sizes
+ * formats.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ *
+ * @Note:
+ * Only horizontal layouts (left-to-right & right-to-left) are
+ * supported by this function. Other layouts, or more sophisticated
+ * kernings are out of scope of this method (the basic driver
+ * interface is meant to be simple).
+ *
+ * They can be implemented by format-specific interfaces.
+ */
static FT_Error
Get_Kerning( FT_Face t1face, /* T1_Face */
FT_UInt left_glyph,
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.h
index 2b1507233dd..206f64a0bca 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1driver.h */
-/* */
-/* High-level Type 1 driver interface (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1driver.h
+ *
+ * High-level Type 1 driver interface (specification).
+ *
+ * Copyright (C) 1996-2019 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 T1DRIVER_H_
@@ -26,14 +26,8 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
-
FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class;
-
FT_END_HEADER
#endif /* T1DRIVER_H_ */
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1errors.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1errors.h
index 9e0151b9571..b35f67a24c9 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1errors.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1errors.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* t1errors.h */
-/* */
-/* Type 1 error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the Type 1 error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * t1errors.h
+ *
+ * Type 1 error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the Type 1 error enumeration constants.
+ *
+ */
#ifndef T1ERRORS_H_
#define T1ERRORS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.c
index 87d40e75660..f9b115b1864 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1gload.c */
-/* */
-/* Type 1 Glyph Loader (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1gload.c
+ *
+ * Type 1 Glyph Loader (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -29,14 +29,14 @@
#include "t1errors.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1gload
+#define FT_COMPONENT t1gload
static FT_Error
@@ -62,6 +62,7 @@
PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
#endif
+
decoder->font_matrix = type1->font_matrix;
decoder->font_offset = type1->font_offset;
@@ -249,6 +250,8 @@
*max_advance = 0;
+ FT_TRACE6(( "T1_Compute_Max_Advance:\n" ));
+
/* for each glyph, parse the glyph charstring and extract */
/* the advance width */
for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ )
@@ -261,6 +264,9 @@
/* ignore the error if one occurred - skip to next glyph */
}
+ FT_TRACE6(( "T1_Compute_Max_Advance: max advance: %f\n",
+ *max_advance / 65536.0 ));
+
psaux->t1_decoder_funcs->done( &decoder );
return FT_Err_Ok;
@@ -282,11 +288,18 @@
FT_Error error;
+ FT_TRACE5(( "T1_Get_Advances:\n" ));
+
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
for ( nn = 0; nn < count; nn++ )
+ {
advances[nn] = 0;
+ FT_TRACE5(( " idx %d: advance height 0 font units\n",
+ first + nn ));
+ }
+
return FT_Err_Ok;
}
@@ -320,6 +333,11 @@
advances[nn] = FIXED_TO_INT( decoder.builder.advance.x );
else
advances[nn] = 0;
+
+ FT_TRACE5(( " idx %d: advance width %d font unit%s\n",
+ first + nn,
+ advances[nn],
+ advances[nn] == 1 ? "" : "s" ));
}
return FT_Err_Ok;
@@ -384,9 +402,9 @@
t1glyph->outline.n_points = 0;
t1glyph->outline.n_contours = 0;
- hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
- ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
- scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
+ hinting = FT_BOOL( !( load_flags & FT_LOAD_NO_SCALE ) &&
+ !( load_flags & FT_LOAD_NO_HINTING ) );
+ scaled = FT_BOOL( !( load_flags & FT_LOAD_NO_SCALE ) );
glyph->hint = hinting;
glyph->scaled = scaled;
@@ -398,7 +416,7 @@
t1glyph,
(FT_Byte**)type1->glyph_names,
face->blend,
- FT_BOOL( hinting ),
+ hinting,
FT_LOAD_TARGET_MODE( load_flags ),
T1_Parse_Glyph );
if ( error )
@@ -406,8 +424,7 @@
must_finish_decoder = TRUE;
- decoder.builder.no_recurse = FT_BOOL(
- ( load_flags & FT_LOAD_NO_RECURSE ) != 0 );
+ decoder.builder.no_recurse = FT_BOOL( load_flags & FT_LOAD_NO_RECURSE );
decoder.num_subrs = type1->num_subrs;
decoder.subrs = type1->subrs;
@@ -528,7 +545,7 @@
/* First of all, scale the points, if we are not hinting */
- if ( !hinting || ! decoder.builder.hints_funcs )
+ if ( !hinting || !decoder.builder.hints_funcs )
for ( n = cur->n_points; n > 0; n--, vec++ )
{
vec->x = FT_MulFix( vec->x, x_scale );
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.h
index 72ef76f6ae3..80440369dc0 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1gload.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1gload.h */
-/* */
-/* Type 1 Glyph Loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1gload.h
+ *
+ * Type 1 Glyph Loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 T1GLOAD_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c
index 9dfa637a695..3896af70ba1 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c
@@ -1,63 +1,63 @@
-/***************************************************************************/
-/* */
-/* t1load.c */
-/* */
-/* Type 1 font loader (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This is the new and improved Type 1 data loader for FreeType 2. The */
- /* old loader has several problems: it is slow, complex, difficult to */
- /* maintain, and contains incredible hacks to make it accept some */
- /* ill-formed Type 1 fonts without hiccup-ing. Moreover, about 5% of */
- /* the Type 1 fonts on my machine still aren't loaded correctly by it. */
- /* */
- /* This version is much simpler, much faster and also easier to read and */
- /* maintain by a great order of magnitude. The idea behind it is to */
- /* _not_ try to read the Type 1 token stream with a state machine (i.e. */
- /* a Postscript-like interpreter) but rather to perform simple pattern */
- /* matching. */
- /* */
- /* Indeed, nearly all data definitions follow a simple pattern like */
- /* */
- /* ... /Field <data> ... */
- /* */
- /* where <data> can be a number, a boolean, a string, or an array of */
- /* numbers. There are a few exceptions, namely the encoding, font name, */
- /* charstrings, and subrs; they are handled with a special pattern */
- /* matching routine. */
- /* */
- /* All other common cases are handled very simply. The matching rules */
- /* are defined in the file `t1tokens.h' through the use of several */
- /* macros calls PARSE_XXX. This file is included twice here; the first */
- /* time to generate parsing callback functions, the second time to */
- /* generate a table of keywords (with pointers to the associated */
- /* callback functions). */
- /* */
- /* The function `parse_dict' simply scans *linearly* a given dictionary */
- /* (either the top-level or private one) and calls the appropriate */
- /* callback when it encounters an immediate keyword. */
- /* */
- /* This is by far the fastest way one can find to parse and read all */
- /* data. */
- /* */
- /* This led to tremendous code size reduction. Note that later, the */
- /* glyph loader will also be _greatly_ simplified, and the automatic */
- /* hinter will replace the clumsy `t1hinter'. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * t1load.c
+ *
+ * Type 1 font loader (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This is the new and improved Type 1 data loader for FreeType 2. The
+ * old loader has several problems: it is slow, complex, difficult to
+ * maintain, and contains incredible hacks to make it accept some
+ * ill-formed Type 1 fonts without hiccup-ing. Moreover, about 5% of
+ * the Type 1 fonts on my machine still aren't loaded correctly by it.
+ *
+ * This version is much simpler, much faster and also easier to read and
+ * maintain by a great order of magnitude. The idea behind it is to
+ * _not_ try to read the Type 1 token stream with a state machine (i.e.
+ * a Postscript-like interpreter) but rather to perform simple pattern
+ * matching.
+ *
+ * Indeed, nearly all data definitions follow a simple pattern like
+ *
+ * ... /Field <data> ...
+ *
+ * where <data> can be a number, a boolean, a string, or an array of
+ * numbers. There are a few exceptions, namely the encoding, font name,
+ * charstrings, and subrs; they are handled with a special pattern
+ * matching routine.
+ *
+ * All other common cases are handled very simply. The matching rules
+ * are defined in the file `t1tokens.h' through the use of several
+ * macros calls PARSE_XXX. This file is included twice here; the first
+ * time to generate parsing callback functions, the second time to
+ * generate a table of keywords (with pointers to the associated
+ * callback functions).
+ *
+ * The function `parse_dict' simply scans *linearly* a given dictionary
+ * (either the top-level or private one) and calls the appropriate
+ * callback when it encounters an immediate keyword.
+ *
+ * This is by far the fastest way one can find to parse and read all
+ * data.
+ *
+ * This led to tremendous code size reduction. Note that later, the
+ * glyph loader will also be _greatly_ simplified, and the automatic
+ * hinter will replace the clumsy `t1hinter'.
+ *
+ */
#include <ft2build.h>
@@ -73,20 +73,20 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
-#define IS_INCREMENTAL (FT_Bool)( face->root.internal->incremental_interface != 0 )
+#define IS_INCREMENTAL FT_BOOL( face->root.internal->incremental_interface )
#else
#define IS_INCREMENTAL 0
#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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1load
+#define FT_COMPONENT t1load
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
@@ -222,11 +222,11 @@
}
- /*************************************************************************/
- /* */
- /* Given a normalized (blend) coordinate, figure out the design */
- /* coordinate appropriate for that value. */
- /* */
+ /**************************************************************************
+ *
+ * Given a normalized (blend) coordinate, figure out the design
+ * coordinate appropriate for that value.
+ */
static FT_Fixed
mm_axis_unmap( PS_DesignMap axismap,
FT_Fixed ncv )
@@ -251,11 +251,11 @@
}
- /*************************************************************************/
- /* */
- /* Given a vector of weights, one for each design, figure out the */
- /* normalized axis coordinates which gave rise to those weights. */
- /* */
+ /**************************************************************************
+ *
+ * Given a vector of weights, one for each design, figure out the
+ * normalized axis coordinates which gave rise to those weights.
+ */
static void
mm_weights_unmap( FT_Fixed* weights,
FT_Fixed* axiscoords,
@@ -293,11 +293,11 @@
}
- /*************************************************************************/
- /* */
- /* Just a wrapper around T1_Get_Multi_Master to support the different */
- /* arguments needed by the GX var distortable fonts. */
- /* */
+ /**************************************************************************
+ *
+ * Just a wrapper around T1_Get_Multi_Master to support the different
+ * arguments needed by the GX var distortable fonts.
+ */
FT_LOCAL_DEF( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master )
@@ -348,16 +348,13 @@
mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' );
}
- if ( blend->num_designs == ( 1U << blend->num_axis ) )
- {
- mm_weights_unmap( blend->default_weight_vector,
- axiscoords,
- blend->num_axis );
+ mm_weights_unmap( blend->default_weight_vector,
+ axiscoords,
+ blend->num_axis );
- for ( i = 0; i < mmaster.num_axis; i++ )
- mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],
- axiscoords[i] );
- }
+ for ( i = 0; i < mmaster.num_axis; i++ )
+ mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],
+ axiscoords[i] );
*master = mmvar;
@@ -387,24 +384,31 @@
for ( n = 0; n < blend->num_designs; n++ )
{
FT_Fixed result = 0x10000L; /* 1.0 fixed */
+ FT_Fixed factor;
for ( m = 0; m < blend->num_axis; m++ )
{
- FT_Fixed factor;
-
-
- /* get current blend axis position; */
/* use a default value if we don't have a coordinate */
- factor = m < num_coords ? coords[m] : 0x8000;
- if ( factor < 0 )
- factor = 0;
- if ( factor > 0x10000L )
- factor = 0x10000L;
+ if ( m >= num_coords )
+ {
+ result >>= 1;
+ continue;
+ }
+ /* get current blend axis position */
+ factor = coords[m];
if ( ( n & ( 1 << m ) ) == 0 )
factor = 0x10000L - factor;
+ if ( factor <= 0 )
+ {
+ result = 0;
+ break;
+ }
+ else if ( factor >= 0x10000L )
+ continue;
+
result = FT_MulFix( result, factor );
}
@@ -477,6 +481,75 @@
FT_LOCAL_DEF( FT_Error )
+ T1_Set_MM_WeightVector( T1_Face face,
+ FT_UInt len,
+ FT_Fixed* weightvector )
+ {
+ PS_Blend blend = face->blend;
+ FT_UInt i, n;
+
+
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ if ( !len && !weightvector )
+ {
+ for ( i = 0; i < blend->num_designs; i++ )
+ blend->weight_vector[i] = blend->default_weight_vector[i];
+ }
+ else
+ {
+ if ( !weightvector )
+ return FT_THROW( Invalid_Argument );
+
+ n = len < blend->num_designs ? len : blend->num_designs;
+
+ for ( i = 0; i < n; i++ )
+ blend->weight_vector[i] = weightvector[i];
+
+ for ( ; i < blend->num_designs; i++ )
+ blend->weight_vector[i] = (FT_Fixed)0;
+
+ if ( len )
+ face->root.face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
+ }
+
+ return FT_Err_Ok;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ T1_Get_MM_WeightVector( T1_Face face,
+ FT_UInt* len,
+ FT_Fixed* weightvector )
+ {
+ PS_Blend blend = face->blend;
+ FT_UInt i;
+
+
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ if ( *len < blend->num_designs )
+ {
+ *len = blend->num_designs;
+ return FT_THROW( Invalid_Argument );
+ }
+
+ for ( i = 0; i < blend->num_designs; i++ )
+ weightvector[i] = blend->weight_vector[i];
+ for ( ; i < *len; i++ )
+ weightvector[i] = (FT_Fixed)0;
+
+ *len = blend->num_designs;
+
+ return FT_Err_Ok;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords )
@@ -573,11 +646,11 @@
}
- /*************************************************************************/
- /* */
- /* Just a wrapper around T1_Set_MM_Design to support the different */
- /* arguments needed by the GX var distortable fonts. */
- /* */
+ /**************************************************************************
+ *
+ * Just a wrapper around T1_Set_MM_Design to support the different
+ * arguments needed by the GX var distortable fonts.
+ */
FT_LOCAL_DEF( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
@@ -719,6 +792,8 @@
if ( error )
goto Exit;
+ FT_TRACE4(( " [" ));
+
blend = face->blend;
memory = face->root.memory;
@@ -741,11 +816,13 @@
goto Exit;
}
+ FT_TRACE4(( " /%.*s", len, token->start ));
+
name = (FT_Byte*)blend->axis_names[n];
if ( name )
{
FT_TRACE0(( "parse_blend_axis_types:"
- " overwriting axis name `%s' with `%*.s'\n",
+ " overwriting axis name `%s' with `%.*s'\n",
name, len, token->start ));
FT_FREE( name );
}
@@ -758,6 +835,8 @@
name[len] = '\0';
}
+ FT_TRACE4(( "]\n" ));
+
Exit:
loader->parser.root.error = error;
}
@@ -802,6 +881,8 @@
blend = face->blend;
num_axis = 0; /* make compiler happy */
+ FT_TRACE4(( " [" ));
+
for ( n = 0; n < num_designs; n++ )
{
T1_TokenRec axis_tokens[T1_MAX_MM_AXIS];
@@ -842,6 +923,7 @@
}
/* now read each axis token into the design position */
+ FT_TRACE4(( " [" )) ;
for ( axis = 0; axis < n_axis; axis++ )
{
T1_Token token2 = axis_tokens + axis;
@@ -850,9 +932,13 @@
parser->root.cursor = token2->start;
parser->root.limit = token2->limit;
blend->design_pos[n][axis] = T1_ToFixed( parser, 0 );
+ FT_TRACE4(( " %f", (double)blend->design_pos[n][axis] / 65536 ));
}
+ FT_TRACE4(( "]" )) ;
}
+ FT_TRACE4(( "]\n" ));
+
loader->parser.root.cursor = old_cursor;
loader->parser.root.limit = old_limit;
}
@@ -899,6 +985,8 @@
goto Exit;
blend = face->blend;
+ FT_TRACE4(( " [" ));
+
/* now read each axis design map */
for ( n = 0; n < num_axis; n++ )
{
@@ -915,6 +1003,8 @@
T1_ToTokenArray( parser, point_tokens,
T1_MAX_MM_MAP_POINTS, &num_points );
+ FT_TRACE4(( " [" ));
+
if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS )
{
FT_ERROR(( "parse_blend_design_map: incorrect table\n" ));
@@ -948,9 +1038,17 @@
map->design_points[p] = T1_ToInt( parser );
map->blend_points [p] = T1_ToFixed( parser, 0 );
+
+ FT_TRACE4(( " [%d %f]",
+ map->design_points[p],
+ (double)map->blend_points[p] / 65536 ));
}
+
+ FT_TRACE4(( "]" ));
}
+ FT_TRACE4(( "]\n" ));
+
parser->root.cursor = old_cursor;
parser->root.limit = old_limit;
@@ -1010,6 +1108,8 @@
old_cursor = parser->root.cursor;
old_limit = parser->root.limit;
+ FT_TRACE4(( "[" ));
+
for ( n = 0; n < num_designs; n++ )
{
token = design_tokens + n;
@@ -1018,8 +1118,12 @@
blend->default_weight_vector[n] =
blend->weight_vector[n] = T1_ToFixed( parser, 0 );
+
+ FT_TRACE4(( " %f", (double)blend->weight_vector[n] / 65536 ));
}
+ FT_TRACE4(( "]\n" ));
+
parser->root.cursor = old_cursor;
parser->root.limit = old_limit;
@@ -1036,6 +1140,20 @@
{
face->len_buildchar = (FT_UInt)T1_ToFixedArray( &loader->parser,
0, NULL, 0 );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_UInt i;
+
+
+ FT_TRACE4(( " [" ));
+ for ( i = 0; i < face->len_buildchar; i++ )
+ FT_TRACE4(( " 0" ));
+
+ FT_TRACE4(( "]\n" ));
+ }
+#endif
+
return;
}
@@ -1071,6 +1189,8 @@
/* if the keyword has a dedicated callback, call it */
if ( field->type == T1_FIELD_TYPE_CALLBACK )
{
+ FT_TRACE4(( " %s", field->ident ));
+
field->reader( (FT_Face)face, loader );
error = loader->parser.root.error;
goto Exit;
@@ -1148,6 +1268,8 @@
max_objects = 0;
}
+ FT_TRACE4(( " %s", field->ident ));
+
if ( *objects )
{
if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
@@ -1167,6 +1289,8 @@
error = FT_Err_Ok;
}
+ FT_TRACE4(( "\n" ));
+
Exit:
return error;
}
@@ -1179,6 +1303,8 @@
FT_UNUSED( face );
loader->keywords_encountered |= T1_PRIVATE;
+
+ FT_TRACE4(( "\n" ));
}
@@ -1258,6 +1384,14 @@
return;
}
+ FT_TRACE4(( " [%f %f %f %f %f %f]\n",
+ (double)temp[0] / 65536 / 1000,
+ (double)temp[1] / 65536 / 1000,
+ (double)temp[2] / 65536 / 1000,
+ (double)temp[3] / 65536 / 1000,
+ (double)temp[4] / 65536 / 1000,
+ (double)temp[5] / 65536 / 1000 ));
+
temp_scale = FT_ABS( temp[3] );
if ( temp_scale == 0 )
@@ -1280,12 +1414,18 @@
temp[5] = FT_DivFix( temp[5], temp_scale );
temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;
}
-
matrix->xx = temp[0];
matrix->yx = temp[1];
matrix->xy = temp[2];
matrix->yy = temp[3];
+ if ( !FT_Matrix_Check( matrix ) )
+ {
+ FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" ));
+ parser->root.error = FT_THROW( Invalid_File_Format );
+ return;
+ }
+
/* note that the offsets must be expressed in integer font units */
offset->x = temp[4] >> 16;
offset->y = temp[5] >> 16;
@@ -1494,6 +1634,15 @@
T1_Skip_Spaces( parser );
}
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE4(( " [" ));
+
+ /* XXX show encoding vector */
+ FT_TRACE4(( "..." ));
+
+ FT_TRACE4(( "]\n" ));
+#endif
+
face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;
parser->root.cursor = cur;
}
@@ -1504,18 +1653,30 @@
{
if ( cur + 17 < limit &&
ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 )
+ {
face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD;
+ FT_TRACE4(( " StandardEncoding\n" ));
+ }
else if ( cur + 15 < limit &&
ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 )
+ {
face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT;
+ FT_TRACE4(( " ExpertEncoding\n" ));
+ }
else if ( cur + 18 < limit &&
ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 )
+ {
face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
+ FT_TRACE4(( " ISOLatin1Encoding\n" ));
+ }
else
+ {
parser->root.error = FT_ERR( Ignore );
+ FT_TRACE4(( "<unknown>\n" ));
+ }
}
}
@@ -1696,6 +1857,15 @@
if ( !loader->num_subrs )
loader->num_subrs = num_subrs;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE4(( " <" ));
+
+ /* XXX show subrs? */
+ FT_TRACE4(( "%d elements", num_subrs ));
+
+ FT_TRACE4(( ">\n" ));
+#endif
+
return;
Fail:
@@ -2017,6 +2187,15 @@
loader->num_glyphs += 1;
}
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE4(( " <" ));
+
+ /* XXX show charstrings? */
+ FT_TRACE4(( "%d elements", loader->num_glyphs ));
+
+ FT_TRACE4(( ">\n" ));
+#endif
+
return;
Fail:
@@ -2024,12 +2203,12 @@
}
- /*************************************************************************/
- /* */
- /* Define the token field static variables. This is a set of */
- /* T1_FieldRec variables. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * Define the token field static variables. This is a set of
+ * T1_FieldRec variables.
+ *
+ */
static
@@ -2216,6 +2395,7 @@
? T1_FIELD_DICT_PRIVATE
: T1_FIELD_DICT_FONTDICT;
+
if ( !( dict & keyword->dict ) )
{
FT_TRACE1(( "parse_dict: found `%s' but ignoring it"
@@ -2330,6 +2510,7 @@
if ( error )
goto Exit;
+ FT_TRACE4(( " top dictionary:\n" ));
error = parse_dict( face, &loader,
parser->base_dict, parser->base_len );
if ( error )
@@ -2339,6 +2520,7 @@
if ( error )
goto Exit;
+ FT_TRACE4(( " private dictionary:\n" ));
error = parse_dict( face, &loader,
parser->private_dict, parser->private_len );
if ( error )
@@ -2349,6 +2531,16 @@
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
+ /* we don't support Multiple Master fonts with intermediate designs; */
+ /* this implies that `num_designs' must be equal to `2^^num_axis' */
+ if ( face->blend &&
+ face->blend->num_designs != ( 1U << face->blend->num_axis ) )
+ {
+ FT_ERROR(( "T1_Open_Face:"
+ " number-of-designs != 2 ^^ number-of-axes\n" ));
+ T1_Done_Blend( face );
+ }
+
if ( face->blend &&
face->blend->num_default_design_vector != 0 &&
face->blend->num_default_design_vector != face->blend->num_axis )
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h
index 03be3f7f937..44f835bde23 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1load.h */
-/* */
-/* Type 1 font loader (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1load.h
+ *
+ * Type 1 font loader (specification).
+ *
+ * Copyright (C) 1996-2019 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 T1LOAD_H_
@@ -106,6 +106,16 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
T1_Done_Blend( T1_Face face );
+ FT_LOCAL( FT_Error )
+ T1_Set_MM_WeightVector( T1_Face face,
+ FT_UInt len,
+ FT_Fixed* weightvector );
+
+ FT_LOCAL( FT_Error )
+ T1_Get_MM_WeightVector( T1_Face face,
+ FT_UInt* len,
+ FT_Fixed* weightvector );
+
#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.c
index 7333c4c9587..741388a645a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1objs.c */
-/* */
-/* Type 1 objects manager (body). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1objs.c
+ *
+ * Type 1 objects manager (body).
+ *
+ * Copyright (C) 1996-2019 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 <ft2build.h>
@@ -36,21 +36,21 @@
#include FT_INTERNAL_POSTSCRIPT_AUX_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1objs
+#define FT_COMPONENT t1objs
- /*************************************************************************/
- /* */
- /* SIZE FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SIZE FUNCTIONS
+ *
+ */
static PSH_Globals_Funcs
@@ -133,11 +133,11 @@
}
- /*************************************************************************/
- /* */
- /* SLOT FUNCTIONS */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * SLOT FUNCTIONS
+ *
+ */
FT_LOCAL_DEF( void )
T1_GlyphSlot_Done( FT_GlyphSlot slot )
@@ -177,24 +177,25 @@
}
- /*************************************************************************/
- /* */
- /* FACE FUNCTIONS */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* T1_Face_Done */
- /* */
- /* <Description> */
- /* The face object destructor. */
- /* */
- /* <Input> */
- /* face :: A typeless pointer to the face object to destroy. */
- /* */
+ /**************************************************************************
+ *
+ * FACE FUNCTIONS
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * T1_Face_Done
+ *
+ * @Description:
+ * The face object destructor.
+ *
+ * @Input:
+ * face ::
+ * A typeless pointer to the face object to destroy.
+ */
FT_LOCAL_DEF( void )
T1_Face_Done( FT_Face t1face ) /* T1_Face */
{
@@ -274,29 +275,34 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* T1_Face_Init */
- /* */
- /* <Description> */
- /* The face object constructor. */
- /* */
- /* <Input> */
- /* stream :: input stream where to load font data. */
- /* */
- /* face_index :: The index of the font face in the resource. */
- /* */
- /* num_params :: Number of additional generic parameters. Ignored. */
- /* */
- /* params :: Additional generic parameters. Ignored. */
- /* */
- /* <InOut> */
- /* face :: The face record to build. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * T1_Face_Init
+ *
+ * @Description:
+ * The face object constructor.
+ *
+ * @Input:
+ * stream ::
+ * input stream where to load font data.
+ *
+ * face_index ::
+ * The index of the font face in the resource.
+ *
+ * num_params ::
+ * Number of additional generic parameters. Ignored.
+ *
+ * params ::
+ * Additional generic parameters. Ignored.
+ *
+ * @InOut:
+ * face ::
+ * The face record to build.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
T1_Face_Init( FT_Stream stream,
FT_Face t1face, /* T1_Face */
@@ -341,6 +347,10 @@
if ( error )
goto Exit;
+ FT_TRACE2(( "T1_Face_Init: %08p (index %d)\n",
+ face,
+ face_index ));
+
/* if we just wanted to check the format, leave successfully now */
if ( face_index < 0 )
goto Exit;
@@ -516,7 +526,8 @@
error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
if ( error &&
- FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
+ FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) &&
+ FT_ERR_NEQ( error, Unimplemented_Feature ) )
goto Exit;
error = FT_Err_Ok;
@@ -564,20 +575,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* T1_Driver_Init */
- /* */
- /* <Description> */
- /* Initializes a given Type 1 driver object. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target driver object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * T1_Driver_Init
+ *
+ * @Description:
+ * Initializes a given Type 1 driver object.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target driver object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
T1_Driver_Init( FT_Module module )
{
@@ -620,17 +632,18 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* T1_Driver_Done */
- /* */
- /* <Description> */
- /* Finalizes a given Type 1 driver. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target Type 1 driver. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * T1_Driver_Done
+ *
+ * @Description:
+ * Finalizes a given Type 1 driver.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target Type 1 driver.
+ */
FT_LOCAL_DEF( void )
T1_Driver_Done( FT_Module driver )
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.h
index 8298e036f4b..2161091f779 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1objs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1objs.h */
-/* */
-/* Type 1 objects manager (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1objs.h
+ *
+ * Type 1 objects manager (specification).
+ *
+ * Copyright (C) 1996-2019 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 T1OBJS_H_
@@ -34,59 +34,59 @@ FT_BEGIN_HEADER
typedef struct T1_Glyph_Hints_ T1_Glyph_Hints;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* T1_Size */
- /* */
- /* <Description> */
- /* A handle to a Type 1 size object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * T1_Size
+ *
+ * @Description:
+ * A handle to a Type 1 size object.
+ */
typedef struct T1_SizeRec_* T1_Size;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* T1_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a Type 1 glyph slot object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * T1_GlyphSlot
+ *
+ * @Description:
+ * A handle to a Type 1 glyph slot object.
+ */
typedef struct T1_GlyphSlotRec_* T1_GlyphSlot;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* T1_CharMap */
- /* */
- /* <Description> */
- /* A handle to a Type 1 character mapping object. */
- /* */
- /* <Note> */
- /* The Type 1 format doesn't use a charmap but an encoding table. */
- /* The driver is responsible for making up charmap objects */
- /* corresponding to these tables. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * T1_CharMap
+ *
+ * @Description:
+ * A handle to a Type 1 character mapping object.
+ *
+ * @Note:
+ * The Type 1 format doesn't use a charmap but an encoding table.
+ * The driver is responsible for making up charmap objects
+ * corresponding to these tables.
+ */
typedef struct T1_CharMapRec_* T1_CharMap;
- /*************************************************************************/
- /* */
- /* HERE BEGINS THE TYPE1 SPECIFIC STUFF */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * HERE BEGINS THE TYPE1 SPECIFIC STUFF
+ *
+ */
- /*************************************************************************/
- /* */
- /* <Type> */
- /* T1_SizeRec */
- /* */
- /* <Description> */
- /* Type 1 size record. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * T1_SizeRec
+ *
+ * @Description:
+ * Type 1 size record.
+ */
typedef struct T1_SizeRec_
{
FT_SizeRec root;
@@ -105,14 +105,14 @@ FT_BEGIN_HEADER
T1_Size_Init( FT_Size size );
- /*************************************************************************/
- /* */
- /* <Type> */
- /* T1_GlyphSlotRec */
- /* */
- /* <Description> */
- /* Type 1 glyph slot record. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * T1_GlyphSlotRec
+ *
+ * @Description:
+ * Type 1 glyph slot record.
+ */
typedef struct T1_GlyphSlotRec_
{
FT_GlyphSlotRec root;
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c
index 8e201e5ef5a..56caeb9e407 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c
@@ -1,36 +1,36 @@
-/***************************************************************************/
-/* */
-/* t1parse.c */
-/* */
-/* Type 1 parser (body). */
-/* */
-/* Copyright 1996-2018 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 Type 1 parser is in charge of the following: */
- /* */
- /* - provide an implementation of a growing sequence of objects called */
- /* a `T1_Table' (used to build various tables needed by the loader). */
- /* */
- /* - opening .pfb and .pfa files to extract their top-level and private */
- /* dictionaries. */
- /* */
- /* - read numbers, arrays & strings from any dictionary. */
- /* */
- /* See `t1load.c' to see how data is loaded from the font file. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * t1parse.c
+ *
+ * Type 1 parser (body).
+ *
+ * Copyright (C) 1996-2019 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 Type 1 parser is in charge of the following:
+ *
+ * - provide an implementation of a growing sequence of objects called
+ * a `T1_Table' (used to build various tables needed by the loader).
+ *
+ * - opening .pfb and .pfa files to extract their top-level and private
+ * dictionaries.
+ *
+ * - read numbers, arrays & strings from any dictionary.
+ *
+ * See `t1load.c' to see how data is loaded from the font file.
+ *
+ */
#include <ft2build.h>
@@ -43,14 +43,14 @@
#include "t1errors.h"
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t1parse
+#define FT_COMPONENT t1parse
/*************************************************************************/
@@ -169,21 +169,21 @@
}
}
- /******************************************************************/
- /* */
- /* Here a short summary of what is going on: */
- /* */
- /* When creating a new Type 1 parser, we try to locate and load */
- /* the base dictionary if this is possible (i.e., for PFB */
- /* files). Otherwise, we load the whole font into memory. */
- /* */
- /* When `loading' the base dictionary, we only setup pointers */
- /* in the case of a memory-based stream. Otherwise, we */
- /* allocate and load the base dictionary in it. */
- /* */
- /* parser->in_pfb is set if we are in a binary (`.pfb') font. */
- /* parser->in_memory is set if we have a memory stream. */
- /* */
+ /*******************************************************************
+ *
+ * Here a short summary of what is going on:
+ *
+ * When creating a new Type 1 parser, we try to locate and load
+ * the base dictionary if this is possible (i.e., for PFB
+ * files). Otherwise, we load the whole font into memory.
+ *
+ * When `loading' the base dictionary, we only setup pointers
+ * in the case of a memory-based stream. Otherwise, we
+ * allocate and load the base dictionary in it.
+ *
+ * parser->in_pfb is set if we are in a binary (`.pfb') font.
+ * parser->in_memory is set if we have a memory stream.
+ */
/* try to compute the size of the base dictionary; */
/* look for a Postscript binary file tag, i.e., 0x8001 */
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.h
index 4ac82ae913e..dab8fddc8b6 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1parse.h */
-/* */
-/* Type 1 parser (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1parse.h
+ *
+ * Type 1 parser (specification).
+ *
+ * Copyright (C) 1996-2019 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 T1PARSE_H_
@@ -28,36 +28,45 @@
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* T1_ParserRec */
- /* */
- /* <Description> */
- /* A PS_ParserRec is an object used to parse a Type 1 fonts very */
- /* quickly. */
- /* */
- /* <Fields> */
- /* root :: The root parser. */
- /* */
- /* stream :: The current input stream. */
- /* */
- /* base_dict :: A pointer to the top-level dictionary. */
- /* */
- /* base_len :: The length in bytes of the top dictionary. */
- /* */
- /* private_dict :: A pointer to the private dictionary. */
- /* */
- /* private_len :: The length in bytes of the private dictionary. */
- /* */
- /* in_pfb :: A boolean. Indicates that we are handling a PFB */
- /* file. */
- /* */
- /* in_memory :: A boolean. Indicates a memory-based stream. */
- /* */
- /* single_block :: A boolean. Indicates that the private dictionary */
- /* is stored in lieu of the base dictionary. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * T1_ParserRec
+ *
+ * @Description:
+ * A PS_ParserRec is an object used to parse a Type 1 fonts very
+ * quickly.
+ *
+ * @Fields:
+ * root ::
+ * The root parser.
+ *
+ * stream ::
+ * The current input stream.
+ *
+ * base_dict ::
+ * A pointer to the top-level dictionary.
+ *
+ * base_len ::
+ * The length in bytes of the top dictionary.
+ *
+ * private_dict ::
+ * A pointer to the private dictionary.
+ *
+ * private_len ::
+ * The length in bytes of the private dictionary.
+ *
+ * in_pfb ::
+ * A boolean. Indicates that we are handling a PFB
+ * file.
+ *
+ * in_memory ::
+ * A boolean. Indicates a memory-based stream.
+ *
+ * single_block ::
+ * A boolean. Indicates that the private dictionary
+ * is stored in lieu of the base dictionary.
+ */
typedef struct T1_ParserRec_
{
PS_ParserRec root;
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1tokens.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1tokens.h
index 43a65d88ea4..97f2dbe0cfa 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1tokens.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1tokens.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t1tokens.h */
-/* */
-/* Type 1 tokenizer (specification). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t1tokens.h
+ *
+ * Type 1 tokenizer (specification).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#undef FT_STRUCTURE
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/type1.c b/Build/source/libs/freetype2/freetype-src/src/type1/type1.c
index 72eff59bfed..ce8557a5fbf 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/type1.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/type1.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* type1.c */
-/* */
-/* FreeType Type 1 driver component (body only). */
-/* */
-/* Copyright 1996-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * type1.c
+ *
+ * FreeType Type 1 driver component (body only).
+ *
+ * Copyright (C) 1996-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/Jamfile b/Build/source/libs/freetype2/freetype-src/src/type42/Jamfile
index b98de05a746..6123b355985 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/type42 Jamfile
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/type42/module.mk b/Build/source/libs/freetype2/freetype-src/src/type42/module.mk
index 3d4732bb6f7..9e9d15455be 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/type42/rules.mk b/Build/source/libs/freetype2/freetype-src/src/type42/rules.mk
index 9325d3898fd..9d71f5300e3 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2018 by
+# Copyright (C) 2002-2019 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/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.c b/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.c
index f579b2708c8..6d4e7a09554 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.c
@@ -1,39 +1,39 @@
-/***************************************************************************/
-/* */
-/* t42drivr.c */
-/* */
-/* High-level Type 42 driver interface (body). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This driver implements Type42 fonts as described in the */
- /* Technical Note #5012 from Adobe, with these limitations: */
- /* */
- /* 1) CID Fonts are not currently supported. */
- /* 2) Incremental fonts making use of the GlyphDirectory keyword */
- /* will be loaded, but the rendering will be using the TrueType */
- /* tables. */
- /* 3) As for Type1 fonts, CDevProc is not supported. */
- /* 4) The Metrics dictionary is not supported. */
- /* 5) AFM metrics are not supported. */
- /* */
- /* In other words, this driver supports Type42 fonts derived from */
- /* TrueType fonts in a non-CID manner, as done by usual conversion */
- /* programs. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * t42drivr.c
+ *
+ * High-level Type 42 driver interface (body).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This driver implements Type42 fonts as described in the
+ * Technical Note #5012 from Adobe, with these limitations:
+ *
+ * 1) CID Fonts are not currently supported.
+ * 2) Incremental fonts making use of the GlyphDirectory keyword
+ * will be loaded, but the rendering will be using the TrueType
+ * tables.
+ * 3) As for Type1 fonts, CDevProc is not supported.
+ * 4) The Metrics dictionary is not supported.
+ * 5) AFM metrics are not supported.
+ *
+ * In other words, this driver supports Type42 fonts derived from
+ * TrueType fonts in a non-CID manner, as done by usual conversion
+ * programs.
+ *
+ */
#include "t42drivr.h"
@@ -47,12 +47,12 @@
#include FT_SERVICE_POSTSCRIPT_INFO_H
#undef FT_COMPONENT
-#define FT_COMPONENT trace_t42
+#define FT_COMPONENT t42
/*
*
- * GLYPH DICT SERVICE
+ * GLYPH DICT SERVICE
*
*/
@@ -98,7 +98,7 @@
/*
*
- * POSTSCRIPT NAME SERVICE
+ * POSTSCRIPT NAME SERVICE
*
*/
@@ -117,7 +117,7 @@
/*
*
- * POSTSCRIPT INFO SERVICE
+ * POSTSCRIPT INFO SERVICE
*
*/
@@ -173,7 +173,7 @@
/*
*
- * SERVICE LIST
+ * SERVICE LIST
*
*/
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.h b/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.h
index 3667f3e0667..a35ca28f847 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42drivr.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t42drivr.h */
-/* */
-/* High-level Type 42 driver interface (specification). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t42drivr.h
+ *
+ * High-level Type 42 driver interface (specification).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * 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 T42DRIVR_H_
@@ -26,14 +26,8 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
-
-
FT_EXPORT_VAR( const FT_Driver_ClassRec ) t42_driver_class;
-
FT_END_HEADER
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42error.h b/Build/source/libs/freetype2/freetype-src/src/type42/t42error.h
index e3978a76077..5fb21439497 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42error.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42error.h
@@ -1,26 +1,26 @@
-/***************************************************************************/
-/* */
-/* t42error.h */
-/* */
-/* Type 42 error codes (specification only). */
-/* */
-/* Copyright 2002-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the Type 42 error enumeration constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * t42error.h
+ *
+ * Type 42 error codes (specification only).
+ *
+ * Copyright (C) 2002-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the Type 42 error enumeration constants.
+ *
+ */
#ifndef T42ERROR_H_
#define T42ERROR_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.c b/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.c
index 66e5c403825..234c0a3e975 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t42objs.c */
-/* */
-/* Type 42 objects manager (body). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t42objs.c
+ *
+ * Type 42 objects manager (body).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * 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 "t42objs.h"
@@ -25,7 +25,7 @@
#undef FT_COMPONENT
-#define FT_COMPONENT trace_t42
+#define FT_COMPONENT t42
static FT_Error
@@ -354,7 +354,8 @@
error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
if ( error &&
- FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
+ FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) &&
+ FT_ERR_NEQ( error, Unimplemented_Feature ) )
goto Exit;
error = FT_Err_Ok;
@@ -457,20 +458,21 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* T42_Driver_Init */
- /* */
- /* <Description> */
- /* Initializes a given Type 42 driver object. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target driver object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /**************************************************************************
+ *
+ * @Function:
+ * T42_Driver_Init
+ *
+ * @Description:
+ * Initializes a given Type 42 driver object.
+ *
+ * @Input:
+ * driver ::
+ * A handle to the target driver object.
+ *
+ * @Return:
+ * FreeType error code. 0 means success.
+ */
FT_LOCAL_DEF( FT_Error )
T42_Driver_Init( FT_Module module ) /* T42_Driver */
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.h b/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.h
index 3bad5135e09..98300cf3485 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42objs.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t42objs.h */
-/* */
-/* Type 42 objects manager (specification). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t42objs.h
+ *
+ * Type 42 objects manager (specification).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * 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 T42OBJS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.c b/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.c
index 4813d1f3f98..b653a133a55 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t42parse.c */
-/* */
-/* Type 42 font parser (body). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t42parse.c
+ *
+ * Type 42 font parser (body).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * 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 "t42parse.h"
@@ -23,14 +23,14 @@
#include FT_INTERNAL_POSTSCRIPT_AUX_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_t42
+#define FT_COMPONENT t42
static void
@@ -149,19 +149,19 @@
parser->base_dict = NULL;
parser->in_memory = 0;
- /*******************************************************************/
- /* */
- /* Here a short summary of what is going on: */
- /* */
- /* When creating a new Type 42 parser, we try to locate and load */
- /* the base dictionary, loading the whole font into memory. */
- /* */
- /* When `loading' the base dictionary, we only set up pointers */
- /* in the case of a memory-based stream. Otherwise, we allocate */
- /* and load the base dictionary in it. */
- /* */
- /* parser->in_memory is set if we have a memory stream. */
- /* */
+ /********************************************************************
+ *
+ * Here a short summary of what is going on:
+ *
+ * When creating a new Type 42 parser, we try to locate and load
+ * the base dictionary, loading the whole font into memory.
+ *
+ * When `loading' the base dictionary, we only set up pointers
+ * in the case of a memory-based stream. Otherwise, we allocate
+ * and load the base dictionary in it.
+ *
+ * parser->in_memory is set if we have a memory stream.
+ */
if ( FT_STREAM_SEEK( 0L ) ||
FT_FRAME_ENTER( 17 ) )
@@ -284,6 +284,13 @@
matrix->xy = temp[2];
matrix->yy = temp[3];
+ if ( !FT_Matrix_Check( matrix ) )
+ {
+ FT_ERROR(( "t42_parse_font_matrix: invalid font matrix\n" ));
+ parser->root.error = FT_THROW( Invalid_File_Format );
+ return;
+ }
+
/* note that the offsets must be expressed in integer font units */
offset->x = temp[4] >> 16;
offset->y = temp[5] >> 16;
@@ -588,6 +595,14 @@
else if ( *cur == '<' )
{
+ if ( string_buf && !allocated )
+ {
+ FT_ERROR(( "t42_parse_sfnts: "
+ "can't handle mixed binary and hex strings\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+
T1_Skip_PS_Token( parser );
if ( parser->root.error )
goto Exit;
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.h b/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.h
index f35d23de635..0c7bb48496d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42parse.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t42parse.h */
-/* */
-/* Type 42 font parser (specification). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t42parse.h
+ *
+ * Type 42 font parser (specification).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * 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 T42PARSE_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/t42types.h b/Build/source/libs/freetype2/freetype-src/src/type42/t42types.h
index d0aa2de5705..a258144ec3d 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/t42types.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/t42types.h
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* t42types.h */
-/* */
-/* Type 42 font data types (specification only). */
-/* */
-/* Copyright 2002-2018 by */
-/* Roberto Alameda. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * t42types.h
+ *
+ * Type 42 font data types (specification only).
+ *
+ * Copyright (C) 2002-2019 by
+ * Roberto Alameda.
+ *
+ * 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 T42TYPES_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/type42/type42.c b/Build/source/libs/freetype2/freetype-src/src/type42/type42.c
index 6a89cfbed1b..0cb7b77eec1 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type42/type42.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type42/type42.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* type42.c */
-/* */
-/* FreeType Type 42 driver component. */
-/* */
-/* Copyright 2002-2018 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * type42.c
+ *
+ * FreeType Type 42 driver component.
+ *
+ * Copyright (C) 2002-2019 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.
+ *
+ */
#define FT_MAKE_OPTION_SINGLE_OBJECT
diff --git a/Build/source/libs/freetype2/freetype-src/src/winfonts/Jamfile b/Build/source/libs/freetype2/freetype-src/src/winfonts/Jamfile
index 4385e3b39f1..4b922261590 100644
--- a/Build/source/libs/freetype2/freetype-src/src/winfonts/Jamfile
+++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/winfonts Jamfile
#
-# Copyright 2001-2018 by
+# Copyright (C) 2001-2019 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/Build/source/libs/freetype2/freetype-src/src/winfonts/fnterrs.h b/Build/source/libs/freetype2/freetype-src/src/winfonts/fnterrs.h
index 3a86af5aace..af29307c75c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/winfonts/fnterrs.h
+++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/fnterrs.h
@@ -1,27 +1,27 @@
-/***************************************************************************/
-/* */
-/* fnterrs.h */
-/* */
-/* Win FNT/FON error codes (specification only). */
-/* */
-/* Copyright 2001-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the Windows FNT/FON error enumeration */
- /* constants. */
- /* */
- /*************************************************************************/
+/****************************************************************************
+ *
+ * fnterrs.h
+ *
+ * Win FNT/FON error codes (specification only).
+ *
+ * Copyright (C) 2001-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This file is used to define the Windows FNT/FON error enumeration
+ * constants.
+ *
+ */
#ifndef FNTERRS_H_
#define FNTERRS_H_
diff --git a/Build/source/libs/freetype2/freetype-src/src/winfonts/module.mk b/Build/source/libs/freetype2/freetype-src/src/winfonts/module.mk
index 13f9077cfc6..82fb0151f87 100644
--- a/Build/source/libs/freetype2/freetype-src/src/winfonts/module.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/winfonts/rules.mk b/Build/source/libs/freetype2/freetype-src/src/winfonts/rules.mk
index d694d1a7711..998d49bc9f2 100644
--- a/Build/source/libs/freetype2/freetype-src/src/winfonts/rules.mk
+++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2018 by
+# Copyright (C) 1996-2019 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/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c b/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c
index 36bd3148d51..2d771be2ccb 100644
--- a/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c
+++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c
@@ -1,21 +1,21 @@
-/***************************************************************************/
-/* */
-/* winfnt.c */
-/* */
-/* FreeType font driver for Windows FNT/FON files */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* Copyright 2003 Huw D M Davies for Codeweavers */
-/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * winfnt.c
+ *
+ * FreeType font driver for Windows FNT/FON files
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ * Copyright 2003 Huw D M Davies for Codeweavers
+ * Copyright 2007 Dmitry Timoshkov for Codeweavers
+ *
+ * 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 <ft2build.h>
@@ -30,14 +30,14 @@
#include FT_SERVICE_WINFNT_H
#include FT_SERVICE_FONT_FORMAT_H
- /*************************************************************************/
- /* */
- /* 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. */
- /* */
+ /**************************************************************************
+ *
+ * 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 trace_winfnt
+#define FT_COMPONENT winfnt
static const FT_Frame_Field winmz_header_fields[] =
@@ -1131,10 +1131,10 @@
winfnt_get_header /* get_header */
};
- /*
- * SERVICE LIST
- *
- */
+ /*
+ * SERVICE LIST
+ *
+ */
static const FT_ServiceDescRec winfnt_services[] =
{
diff --git a/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.h b/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.h
index 4885c9d7452..b628ad4c425 100644
--- a/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.h
+++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.h
@@ -1,20 +1,20 @@
-/***************************************************************************/
-/* */
-/* winfnt.h */
-/* */
-/* FreeType font driver for Windows FNT/FON files */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * winfnt.h
+ *
+ * FreeType font driver for Windows FNT/FON files
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ * Copyright 2007 Dmitry Timoshkov for Codeweavers
+ *
+ * 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 WINFNT_H_
@@ -28,9 +28,6 @@
FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
-#error "this module does not support PIC yet"
-#endif
typedef struct WinMZ_HeaderRec_
{
@@ -153,9 +150,6 @@ FT_BEGIN_HEADER
FT_FaceRec root;
FNT_Font font;
- FT_CharMap charmap_handle;
- FT_CharMapRec charmap; /* a single charmap per face */
-
} FNT_FaceRec, *FNT_Face;