diff options
author | David Schweinsberg <[email protected]> | 2015-12-10 20:00:37 -0800 |
---|---|---|
committer | David Schweinsberg <[email protected]> | 2015-12-10 20:00:37 -0800 |
commit | 984c5f23789a0f39ff50e0f6cb157b8190089d4a (patch) | |
tree | f76dd2c9cea79ab44dec82be3b186e60d1327444 | |
parent | 0d66e1a325e1adec9d4be69cdd9c128c77c3a1f4 (diff) |
Fixed handling of CFF hintmask/cntrmask data bytes.
-rw-r--r-- | nbproject/project.properties | 145 | ||||
-rw-r--r-- | src/net/java/dev/typecast/t2/T2Interpreter.java | 26 |
2 files changed, 84 insertions, 87 deletions
diff --git a/nbproject/project.properties b/nbproject/project.properties index 905cf14..2929f66 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,94 +1,81 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processors.list= -annotation.processing.run.all.processors=true +#Thu Dec 10 17:14:49 PST 2015 +jnlp.offline-allowed=false +javadoc.splitindex=true +build.classes.excludes=**/*.java,**/*.form +jnlp.codebase.url=file\:/Users/david/sandbox/typecast/dist/ +javadoc.author=false +build.sysclasspath=ignore +javac.target=1.8 +build.generated.dir=${build.dir}/generated +run.classpath=${javac.classpath}\:${build.classes.dir}\:${file.reference.jlfgr-1_0.jar} application.args= -application.desc=An OpenType font development environment. -application.homepage=https://github.com/dcsch/typecast +debug.test.classpath=${run.test.classpath} +jnlp.descriptor=application +build.dir=build +javac.deprecation=true +jnlp.signed=false application.splash= -application.title=Typecast +test.src.dir=test +junit.selected.version=3 +jar.archive.disabled=${jnlp.enabled} +application.homepage=https\://github.com/dcsch/typecast +includes=** application.vendor=David Schweinsberg -auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml +mkdist.disabled=false +jar.compress=true +jnlp.mixed.code=default +annotation.processing.processors.list= +javac.external.vm=false +javadoc.version=false build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# This directory is removed when the project is cleaned: dist.dir=dist +manifest.file=manifest.mf +javac.source=1.8 +run.jvmargs=-Dapple.laf.useScreenMenuBar\=true +manifest.custom.permissions= +run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir} +file.reference.jlfgr-1_0.jar=lib/jlfgr-1_0.jar +build.generated.sources.dir=${build.dir}/generated-sources +jnlp.signing= +javadoc.notree=false dist.jar=${dist.dir}/typecast.jar +manifest.custom.caller.allowable.codebase= +platform.active=default_platform +manifest.custom.application.library.allowable.codebase= +annotation.processing.enabled=true +main.class=net.java.dev.typecast.app.editor.Main dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.jlfgr-1_0.jar=lib/jlfgr-1_0.jar -includes=** -jar.archive.disabled=${jnlp.enabled} -jar.compress=true -jar.index=${jnlp.enabled} -javac.classpath= -# Space-separated list of extra javac options -javac.compilerargs=-Xlint -javac.deprecation=true -javac.external.vm=false -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${libs.junit.classpath} javadoc.additionalparam= -javadoc.author=false -javadoc.encoding= +auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml +javac.classpath= javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false +manifest.custom.codebase= +annotation.processing.enabled.in.editor=false javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle=Typecast -jnlp.codebase.type=local -jnlp.codebase.url=file:/Users/david/sandbox/typecast/dist/ -jnlp.descriptor=application -jnlp.enabled=false -jnlp.mixed.code=default -jnlp.offline-allowed=false -jnlp.signed=false -jnlp.signing= -jnlp.signing.alias= +javadoc.encoding= +build.test.classes.dir=${build.dir}/test/classes +jar.index=${jnlp.enabled} +javac.compilerargs=-Xlint +project.license=apache20 +application.desc=An OpenType font development environment. jnlp.signing.keystore= -main.class=net.java.dev.typecast.app.editor.Main -# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found. -manifest.custom.application.library.allowable.codebase= -# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts. -manifest.custom.caller.allowable.codebase= -# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed -manifest.custom.codebase= -# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) -manifest.custom.permissions= -manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=default_platform -project.license=apache20 -run.classpath=\ +annotation.processing.run.all.processors=true +excludes= +application.title=Typecast +jnlp.codebase.type=local +javac.processorpath=${javac.classpath} +build.test.results.dir=${build.dir}/test/results +endorsed.classpath= +javadoc.use=true +javadoc.nonavbar=false +jnlp.signing.alias= +javadoc.windowtitle=Typecast +javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir}:\ - ${file.reference.jlfgr-1_0.jar} -run.jvmargs=-Dapple.laf.useScreenMenuBar=true -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} + ${libs.junit_4.classpath}:\ + ${libs.hamcrest.classpath} src.dir=src -test.src.dir=test +debug.classpath=${run.classpath} +jnlp.enabled=false diff --git a/src/net/java/dev/typecast/t2/T2Interpreter.java b/src/net/java/dev/typecast/t2/T2Interpreter.java index e5acfc6..7282c9c 100644 --- a/src/net/java/dev/typecast/t2/T2Interpreter.java +++ b/src/net/java/dev/typecast/t2/T2Interpreter.java @@ -39,6 +39,8 @@ public class T2Interpreter { private int _subrStackIndex = 0; private final Number[] _transientArray = new Number[TRANSIENT_ARRAY_ELEMENT_COUNT]; + private int _stemCount = 0; + private ArrayList<Point> _points; /** Creates a new instance of T2Interpreter */ @@ -536,22 +538,30 @@ public class T2Interpreter { } private void _hstemhm() { - + _stemCount += getArgCount() / 2; clearArg(); } private void _vstemhm() { - + _stemCount += getArgCount() / 2; clearArg(); } - private void _hintmask() { - + private void _hintmask(CharstringType2 cs) { + _stemCount += getArgCount() / 2; + int maskLen = (_stemCount - 1) / 8 + 1; + for (int i = 0; i < maskLen; ++i) { + cs.nextByte(); + } clearArg(); } - private void _cntrmask() { - + private void _cntrmask(CharstringType2 cs) { + _stemCount += getArgCount() / 2; + int maskLen = (_stemCount - 1) / 8 + 1; + for (int i = 0; i < maskLen; ++i) { + cs.nextByte(); + } clearArg(); } @@ -917,10 +927,10 @@ public class T2Interpreter { _hstemhm(); break; case T2Mnemonic.HINTMASK: - _hintmask(); + _hintmask(cs); break; case T2Mnemonic.CNTRMASK: - _cntrmask(); + _cntrmask(cs); break; case T2Mnemonic.RMOVETO: _rmoveto(); |