foray-commit Mailing List for FOray (Page 80)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(4) |
Dec
|
|
From: <vic...@us...> - 2021-02-07 18:44:41
|
Revision: 11895
http://sourceforge.net/p/foray/code/11895
Author: victormote
Date: 2021-02-07 18:44:39 +0000 (Sun, 07 Feb 2021)
Log Message:
-----------
Rename test classes for consistency.
Modified Paths:
--------------
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java
Added Paths:
-----------
trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/FontServer4aTests.java
Removed Paths:
-------------
trunk/foray/foray-font/src/test/java/org/foray/font/TestFont4a.java
trunk/foray/foray-font/src/test/java/org/foray/font/TestFontServer4a.java
Copied: trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java (from rev 11880, trunk/foray/foray-font/src/test/java/org/foray/font/TestFont4a.java)
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java (rev 0)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2021-02-07 18:44:39 UTC (rev 11895)
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.font;
+
+import org.foray.common.FontOptions4a;
+import org.foray.common.i18n.Orthography4a;
+import org.foray.font.config.RegisteredFont;
+
+import org.axsl.font.FontException;
+import org.axsl.ps.CharSet;
+import org.axsl.ps.Encoding;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * JUnit test class for the class {@link Font4a}.
+ */
+public class Font4aTests {
+
+ /**
+ * Ensures that we can read the serialized metrics information for the
+ * Base-14 fonts, and some basic testing of that data.
+ * @throws FontException For font system errors.
+ */
+ @Test
+ public void testBase14() throws FontException {
+ final FontServer4a server = FontServer4aTests.getServer();
+ Assert.assertNotNull(server);
+ final RegisteredFont rf = server.getRegisteredFont("Base14-Times");
+ Assert.assertNotNull(rf);
+ final FsType1Font fsf = (FsType1Font) rf.getFreeStandingFont();
+ Assert.assertNotNull(fsf);
+ final Encoding encoding = fsf.getInternalEncoding();
+ Assert.assertNotNull(encoding);
+ final CharSet charSet = fsf.getCharSet();
+
+ final int metricIndex1 = charSet.getIndex(0xC4);
+ /* Line 265 of Times-Roman.afm shows the width of A-dieresis to be 722. */
+ Assert.assertEquals(722, fsf.width(metricIndex1, 1000));
+ final int metricIndex2 = charSet.getIndex(0xD5);
+ /* Line 321 of Times-Roman.afm shows the width of (O-tilde to be 722. */
+ Assert.assertEquals(722, fsf.width(metricIndex2, 1000));
+
+ /* Get the kerning value for an A-dieresis and an O-tilde, found at line 519 of the AFM for Times-Roman. */
+ final int kernValue = fsf.kern(metricIndex1, metricIndex2);
+ Assert.assertEquals(-55, kernValue);
+ }
+
+ /**
+ * Functional test of getting the glyph widths and kerning for a String.
+ * @throws FontException For font system errors.
+ */
+ @Test
+ public void testWidth() throws FontException {
+ final FontOptions4a fontOptionsWithKerning = new FontOptions4a();
+ fontOptionsWithKerning.setKerning(true);
+ final FontOptions4a fontOptionsWithoutKerning = new FontOptions4a();
+ fontOptionsWithoutKerning.setKerning(false);
+
+ final FontServer4a server = FontServer4aTests.getServer();
+ Assert.assertNotNull(server);
+ final RegisteredFont rf = server.getRegisteredFont("Base14-Helvetica");
+ Assert.assertNotNull(rf);
+ final FreeStandingFont fsf = rf.getFreeStandingFont();
+ Assert.assertNotNull(fsf);
+
+ final FontConsumer4a fontConsumer = server.makeFontConsumer();
+ final Font4a font = rf.getBestFont();
+ final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
+ final FontUse4a fontUse = new FontUse4a(consumerFont, null, font.getInternalEncoding());
+
+ final String testString = "Test of Centering";
+
+ /* Test with kerning.
+ * From the Helvetica AFM file, the widths are as follows:
+ * T(611) + kern-T,e(-120) + e(556) + kern-e,s(0) + s(500) + kern-s,t(0) + t(278)
+ * + kern-t,space(0) + space(278) + kern-space,o(0)
+ * + o(556) + kern-o,f(0) + f(278)
+ * + kern-f,space(0) + space(278) + kern-space,C(0)
+ * + C(722) + kern-C,e(0) + e(556) + kern-e,n(0) + n(556) + kern-n,t(0) + t(278)
+ * + kern-t,e(0) + e(556) + kern-e,r(0) + r(333) + kern-r,i(15) + i(222) + kern-i,n(0)
+ * + n(556) + kern-n,g(0) + g(556)
+ * = 7,565.
+ * If these are scaled to 12 points, the millipoints used are 7565 * 12
+ * = 90,780. */
+ Assert.assertEquals(90780, fontUse.width(
+ testString, 0, testString.length(), 12000, 0, 0, fontOptionsWithKerning, Orthography4a.USA));
+
+ /* Test without kerning.
+ * Total kerning = -105.
+ * Adjusted text space units = 7,565 + 105 = 7,670.
+ * When scaled to 12 points, the millipoints used are 7670 * 12 = 92,040. */
+ Assert.assertEquals(92040, fontUse.width(
+ testString, 0, testString.length(), 12000, 0, 0, fontOptionsWithoutKerning, Orthography4a.USA));
+
+ /* Test with word spacing.
+ * Word spacing = 300.
+ * Number of word spaces = 2.
+ * Total word spacing = 600.
+ * Total space (kerning on) = 90,780 + 600 = 91,380. */
+ Assert.assertEquals(91380, fontUse.width(
+ testString, 0, testString.length(), 12000, 0, 300, fontOptionsWithKerning, Orthography4a.USA));
+
+ /* Test with letter spacing.
+ * Letter spacing = 5.
+ * Number of word spaces = 16.
+ * Total word spacing = 80.
+ * Total space (kerning on) = 90,780 + 80 = 90,860. */
+ Assert.assertEquals(90860, fontUse.width(
+ testString, 0, testString.length(), 12000, 5, 0, fontOptionsWithKerning, Orthography4a.USA));
+
+ /* Test with both word spacing and letter spacing, using same parameters as above.
+ * Total space (kerning on) = 90,780 + 600 + 80 = 91,460. */
+ Assert.assertEquals(91460, fontUse.width(
+ testString, 0, testString.length(), 12000, 5, 300, fontOptionsWithKerning, Orthography4a.USA));
+ }
+
+}
Copied: trunk/foray/foray-font/src/test/java/org/foray/font/FontServer4aTests.java (from rev 11880, trunk/foray/foray-font/src/test/java/org/foray/font/TestFontServer4a.java)
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/FontServer4aTests.java (rev 0)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/FontServer4aTests.java 2021-02-07 18:44:39 UTC (rev 11895)
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.font;
+
+import org.foray.common.Environment;
+import org.foray.common.url.UrlFactory;
+
+import org.axsl.font.FontException;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+/**
+ * JUnit test class for the class {@link FontServer4a}.
+ */
+public class FontServer4aTests {
+
+ /** A FontServer available for testing. */
+ private static FontServer4a fontServer;
+
+ /**
+ * Provides static access to a static FOrayFontServer instance for testing.
+ * @return The FOrayFontServer to be used for testing.
+ * @throws FontException For errors creating the Server.
+ */
+ public static FontServer4a getServer() throws FontException {
+ if (FontServer4aTests.fontServer == null) {
+ final FontServer4a fontServer = new FontServer4a();
+ InputStream fontConfigInputStream = null;
+ try {
+ fontConfigInputStream = new FileInputStream("src/test/resources/font-config.xml");
+ } catch (final FileNotFoundException e) {
+ throw new FontException(e);
+ }
+ fontServer.setup(fontConfigInputStream, null);
+ FontServer4aTests.fontServer = fontServer;
+ }
+ return FontServer4aTests.fontServer;
+ }
+
+ /**
+ * Creates URL for a test font resource.
+ * @param resource The name of the resource relative to the foray-font/resource directory in the
+ * sandbox.
+ * @return The URL for the requested test font resource.
+ * @throws IOException For errors getting the build properties or creating the URL.
+ */
+ public static URL getTestFont(final String resource) throws IOException {
+ final Properties buildProperties = Environment.getBuildProperties();
+ final String foraySandbox = buildProperties.getProperty(
+ "foray.sandbox");
+ final URL fontUrl = UrlFactory.createURL("file", null,
+ foraySandbox + "/foray-font/resource/" + resource);
+ return fontUrl;
+ }
+
+ /**
+ * Ensures that we can create a FontServer.
+ * @throws FontException For font system errors.
+ */
+ @Test
+ public void testBase14() throws FontException {
+ final FontServer4a server = FontServer4aTests.getServer();
+ Assert.assertNotNull(server);
+ }
+
+}
Deleted: trunk/foray/foray-font/src/test/java/org/foray/font/TestFont4a.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/TestFont4a.java 2021-02-06 22:44:20 UTC (rev 11894)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/TestFont4a.java 2021-02-07 18:44:39 UTC (rev 11895)
@@ -1,145 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.font;
-
-import org.foray.common.FontOptions4a;
-import org.foray.common.i18n.Orthography4a;
-import org.foray.font.config.RegisteredFont;
-
-import org.axsl.font.FontException;
-import org.axsl.ps.CharSet;
-import org.axsl.ps.Encoding;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * JUnit test class for the class {@link Font4a}.
- */
-public class TestFont4a {
-
- /**
- * Ensures that we can read the serialized metrics information for the
- * Base-14 fonts, and some basic testing of that data.
- * @throws FontException For font system errors.
- */
- @Test
- public void testBase14() throws FontException {
- final FontServer4a server = TestFontServer4a.getServer();
- Assert.assertNotNull(server);
- final RegisteredFont rf = server.getRegisteredFont("Base14-Times");
- Assert.assertNotNull(rf);
- final FsType1Font fsf = (FsType1Font) rf.getFreeStandingFont();
- Assert.assertNotNull(fsf);
- final Encoding encoding = fsf.getInternalEncoding();
- Assert.assertNotNull(encoding);
- final CharSet charSet = fsf.getCharSet();
-
- final int metricIndex1 = charSet.getIndex(0xC4);
- /* Line 265 of Times-Roman.afm shows the width of A-dieresis to be 722. */
- Assert.assertEquals(722, fsf.width(metricIndex1, 1000));
- final int metricIndex2 = charSet.getIndex(0xD5);
- /* Line 321 of Times-Roman.afm shows the width of (O-tilde to be 722. */
- Assert.assertEquals(722, fsf.width(metricIndex2, 1000));
-
- /* Get the kerning value for an A-dieresis and an O-tilde, found at line 519 of the AFM for Times-Roman. */
- final int kernValue = fsf.kern(metricIndex1, metricIndex2);
- Assert.assertEquals(-55, kernValue);
- }
-
- /**
- * Functional test of getting the glyph widths and kerning for a String.
- * @throws FontException For font system errors.
- */
- @Test
- public void testWidth() throws FontException {
- final FontOptions4a fontOptionsWithKerning = new FontOptions4a();
- fontOptionsWithKerning.setKerning(true);
- final FontOptions4a fontOptionsWithoutKerning = new FontOptions4a();
- fontOptionsWithoutKerning.setKerning(false);
-
- final FontServer4a server = TestFontServer4a.getServer();
- Assert.assertNotNull(server);
- final RegisteredFont rf = server.getRegisteredFont("Base14-Helvetica");
- Assert.assertNotNull(rf);
- final FreeStandingFont fsf = rf.getFreeStandingFont();
- Assert.assertNotNull(fsf);
-
- final FontConsumer4a fontConsumer = server.makeFontConsumer();
- final Font4a font = rf.getBestFont();
- final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
- final FontUse4a fontUse = new FontUse4a(consumerFont, null, font.getInternalEncoding());
-
- final String testString = "Test of Centering";
-
- /* Test with kerning.
- * From the Helvetica AFM file, the widths are as follows:
- * T(611) + kern-T,e(-120) + e(556) + kern-e,s(0) + s(500) + kern-s,t(0) + t(278)
- * + kern-t,space(0) + space(278) + kern-space,o(0)
- * + o(556) + kern-o,f(0) + f(278)
- * + kern-f,space(0) + space(278) + kern-space,C(0)
- * + C(722) + kern-C,e(0) + e(556) + kern-e,n(0) + n(556) + kern-n,t(0) + t(278)
- * + kern-t,e(0) + e(556) + kern-e,r(0) + r(333) + kern-r,i(15) + i(222) + kern-i,n(0)
- * + n(556) + kern-n,g(0) + g(556)
- * = 7,565.
- * If these are scaled to 12 points, the millipoints used are 7565 * 12
- * = 90,780. */
- Assert.assertEquals(90780, fontUse.width(
- testString, 0, testString.length(), 12000, 0, 0, fontOptionsWithKerning, Orthography4a.USA));
-
- /* Test without kerning.
- * Total kerning = -105.
- * Adjusted text space units = 7,565 + 105 = 7,670.
- * When scaled to 12 points, the millipoints used are 7670 * 12 = 92,040. */
- Assert.assertEquals(92040, fontUse.width(
- testString, 0, testString.length(), 12000, 0, 0, fontOptionsWithoutKerning, Orthography4a.USA));
-
- /* Test with word spacing.
- * Word spacing = 300.
- * Number of word spaces = 2.
- * Total word spacing = 600.
- * Total space (kerning on) = 90,780 + 600 = 91,380. */
- Assert.assertEquals(91380, fontUse.width(
- testString, 0, testString.length(), 12000, 0, 300, fontOptionsWithKerning, Orthography4a.USA));
-
- /* Test with letter spacing.
- * Letter spacing = 5.
- * Number of word spaces = 16.
- * Total word spacing = 80.
- * Total space (kerning on) = 90,780 + 80 = 90,860. */
- Assert.assertEquals(90860, fontUse.width(
- testString, 0, testString.length(), 12000, 5, 0, fontOptionsWithKerning, Orthography4a.USA));
-
- /* Test with both word spacing and letter spacing, using same parameters as above.
- * Total space (kerning on) = 90,780 + 600 + 80 = 91,460. */
- Assert.assertEquals(91460, fontUse.width(
- testString, 0, testString.length(), 12000, 5, 300, fontOptionsWithKerning, Orthography4a.USA));
- }
-
-}
Deleted: trunk/foray/foray-font/src/test/java/org/foray/font/TestFontServer4a.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/TestFontServer4a.java 2021-02-06 22:44:20 UTC (rev 11894)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/TestFontServer4a.java 2021-02-07 18:44:39 UTC (rev 11895)
@@ -1,100 +0,0 @@
-/*
- * Copyright 2007 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.font;
-
-import org.foray.common.Environment;
-import org.foray.common.url.UrlFactory;
-
-import org.axsl.font.FontException;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Properties;
-
-/**
- * JUnit test class for the class {@link FontServer4a}.
- */
-public class TestFontServer4a {
-
- /** A FontServer available for testing. */
- private static FontServer4a fontServer;
-
- /**
- * Provides static access to a static FOrayFontServer instance for testing.
- * @return The FOrayFontServer to be used for testing.
- * @throws FontException For errors creating the Server.
- */
- public static FontServer4a getServer() throws FontException {
- if (TestFontServer4a.fontServer == null) {
- final FontServer4a fontServer = new FontServer4a();
- InputStream fontConfigInputStream = null;
- try {
- fontConfigInputStream = new FileInputStream("src/test/resources/font-config.xml");
- } catch (final FileNotFoundException e) {
- throw new FontException(e);
- }
- fontServer.setup(fontConfigInputStream, null);
- TestFontServer4a.fontServer = fontServer;
- }
- return TestFontServer4a.fontServer;
- }
-
- /**
- * Creates URL for a test font resource.
- * @param resource The name of the resource relative to the foray-font/resource directory in the
- * sandbox.
- * @return The URL for the requested test font resource.
- * @throws IOException For errors getting the build properties or creating the URL.
- */
- public static URL getTestFont(final String resource) throws IOException {
- final Properties buildProperties = Environment.getBuildProperties();
- final String foraySandbox = buildProperties.getProperty(
- "foray.sandbox");
- final URL fontUrl = UrlFactory.createURL("file", null,
- foraySandbox + "/foray-font/resource/" + resource);
- return fontUrl;
- }
-
- /**
- * Ensures that we can create a FontServer.
- * @throws FontException For font system errors.
- */
- @Test
- public void testBase14() throws FontException {
- final FontServer4a server = TestFontServer4a.getServer();
- Assert.assertNotNull(server);
- }
-
-}
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java 2021-02-06 22:44:20 UTC (rev 11894)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java 2021-02-07 18:44:39 UTC (rev 11895)
@@ -32,7 +32,7 @@
import org.foray.common.io.RandomAccessInput;
import org.foray.common.io.SimpleDataSource;
import org.foray.font.FontServer4a;
-import org.foray.font.TestFontServer4a;
+import org.foray.font.FontServer4aTests;
import org.axsl.font.FontException;
import org.axsl.ps.CharSet;
@@ -58,7 +58,7 @@
*/
@Test
public void test01() throws FontException, IOException {
- final FontServer4a server = TestFontServer4a.getServer();
+ final FontServer4a server = FontServer4aTests.getServer();
final InputStream is = new FileInputStream("src/main/data/base-14/Times-Roman.afm");
Assert.assertNotNull(is);
final DataSource ds = new SimpleDataSource("", is, "", null);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-06 22:44:22
|
Revision: 11894
http://sourceforge.net/p/foray/code/11894
Author: victormote
Date: 2021-02-06 22:44:20 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
1. Conform to aXSL changes renaming methods. 2. For the predefined encodings, force the appropriate subclasses to address whether built-in to PS and PDF individually.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfEncoding.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFont4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a04.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a12.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfEncoding.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfEncoding.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfEncoding.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -70,7 +70,7 @@
@Override
public String pdfReference(final PdfDocument4a doc) {
- if (this.encoding.isPredefinedPdf()) {
+ if (this.encoding.isBuiltInPdf()) {
return "/" + this.getName();
}
if (! (this.encoding instanceof PsEncoding)) {
@@ -81,7 +81,7 @@
@Override
public String toPDF(final PdfDocument4a doc) {
- if (this.encoding.isPredefinedPdf()) {
+ if (this.encoding.isBuiltInPdf()) {
/* The predefined PDF encodings are present by name. They do not
* need to be written into the document. */
return new String();
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFont4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFont4a.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFont4a.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -197,7 +197,7 @@
* We're not sure why this is necessary, but it seems to be. */
if (getFont().isPdfStandardFont()) {
final Encoding encoding = getEncoding();
- if (encoding.isPredefinedPdf()) {
+ if (encoding.isBuiltInPdf()) {
return true;
}
if (encoding == getFont().getInternalEncoding()) {
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -39,16 +39,6 @@
public static final long serialVersionUID = -6516855352094857929L;
@Override
- public boolean isPredefinedPs() {
- return false;
- }
-
- @Override
- public boolean isPredefinedPdf() {
- return false;
- }
-
- @Override
public boolean canEncode(final int codePoint) {
return this.encodeCharacter(codePoint) != 0;
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a04.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a04.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a04.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -33,9 +33,8 @@
import org.axsl.ps.Cmap04;
/**
- * Class containing a set of 16-bit Unicode ranges that sequentially map to the
- * same-sized range of glyph indexes. The contents are analogous to a Format 4
- * TrueType Font cmap table (from which this class derives its name).
+ * Class containing a set of 16-bit Unicode ranges that sequentially map to the same-sized range of glyph indexes.
+ * The contents are analogous to a Format 4 TrueType Font cmap table (from which this class derives its name).
*/
public class Cmap4a04 extends Cmap4a implements Cmap04 {
@@ -143,4 +142,18 @@
return INVALID_UNICODE_CHAR;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* TODO Make this class abstract and make a subclass that handled custom instances, so that we can keep the
+ * prebuilt instances separate, and return different values here. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* TODO Make this class abstract and make a subclass that handled custom instances, so that we can keep the
+ * prebuilt instances separate, and return different values here. */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a12.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a12.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Cmap4a12.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -31,9 +31,8 @@
import org.axsl.ps.Cmap12;
/**
- * Class containing a set of 32-bit Unicode ranges that sequentially map to the
- * same-sized range of glyph indexes. The contents are analogous to a Format 12
- * TrueType Font cmap table (from which this class derives its name).
+ * Class containing a set of 32-bit Unicode ranges that sequentially map to the same-sized range of glyph indexes.
+ * The contents are analogous to a Format 12 TrueType Font cmap table (from which this class derives its name).
*/
public class Cmap4a12 extends Cmap4a implements Cmap12 {
@@ -137,4 +136,18 @@
return INVALID_UNICODE_CHAR;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* TODO Make this class abstract and make a subclass that handled custom instances, so that we can keep the
+ * prebuilt instances separate, and return different values here. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* TODO Make this class abstract and make a subclass that handled custom instances, so that we can keep the
+ * prebuilt instances separate, and return different values here. */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -52,8 +52,7 @@
* <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class Encoding4aLatinExtra extends EncodingVector4a
- implements Serializable {
+public final class Encoding4aLatinExtra extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 104918159455810006L;
@@ -311,4 +310,14 @@
return null;
}
+ @Override
+ public boolean isBuiltInPs() {
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -983,4 +983,17 @@
return PsEncoding.Predefined.CE;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* See PSLRM 3, Appendix E, where this Encoding Vector is defined, but where, after Table E.1, it is include
+ * in the list of encoding that "are not defined as named encodings in the PostScript interpreter itself." */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* Not mentioned in the PDF Reference 6. */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -36,8 +36,7 @@
import java.util.List;
/**
- * An encoding that is not one of the predefined encodings, usually parsed from
- * a Type 1 Font.
+ * An encoding that is not one of the predefined encodings, usually parsed from a Type 1 Font.
*/
public class EncodingCustom extends EncodingVector4a {
@@ -71,4 +70,14 @@
return null;
}
+ @Override
+ public boolean isBuiltInPs() {
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -36,22 +36,19 @@
import java.io.Serializable;
/**
- * Class containing hard-coded values that represent the Expert
- * Encoding Vector documented at PostScript Language Reference, 3rd Edition,
- * Appendix E.9.
+ * Class containing hard-coded values that represent the Expert Encoding Vector documented at PostScript Language
+ * Reference, Third Edition, Appendix E.9 and Appendix E.10.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/expert-ps.txt</li>
+ * <li>input-file: file:./resource/encoding/expert-ps.txt</li>
* <li>column-number: 1</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingExpert extends EncodingVector4a
- implements Serializable {
+public final class EncodingExpert extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 646506681417105614L;
@@ -779,4 +776,18 @@
return PsEncoding.Predefined.EXPERT;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* See PSLRM 3, Appendix E, where this Encoding Vector is defined, but where, after Table E.1, it is include
+ * in the list of encoding that "are not defined as named encodings in the PostScript interpreter itself." */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* See PDF Reference 6, Appendix D, where the the first sentence seems to indicate that this Encoding is
+ * predefined in PDF consumer applications. */
+ return true;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -36,22 +36,19 @@
import java.io.Serializable;
/**
- * Class containing hard-coded values that represent the ExpertSubset
- * Encoding Vector documented at PostScript Language Reference, 3rd Edition,
- * Appendix E.9 and E.11.
+ * Class containing hard-coded values that represent the ExpertSubset Encoding Vector documented at PostScript Language
+ * Reference, Third Edition, Appendix E.9 and E.11.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/expert-ps.txt</li>
+ * <li>input-file: file:./resource/encoding/expert-ps.txt</li>
* <li>column-number: 2</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingExpertSubset extends EncodingVector4a
- implements Serializable {
+public final class EncodingExpertSubset extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 613751704171026729L;
@@ -464,4 +461,17 @@
return PsEncoding.Predefined.EXPERT_SUBSET;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* See PSLRM 3, Appendix E, where this Encoding Vector is defined, but where, after Table E.1, it is include
+ * in the list of encoding that "are not defined as named encodings in the PostScript interpreter itself." */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* Not mentioned in PDF Reference 6. */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -36,21 +36,19 @@
import java.io.Serializable;
/**
- * Class containing hard-coded values that represent the ISOLatin1Encoding
- * Encoding Vector documented at PLRM2, Appendix E.7.
+ * Class containing hard-coded values that represent the ISOLatin1Encoding Encoding Vector documented at PSLRM, Third
+ * Edition, Appendix E.7.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/latin-ps.txt</li>
+ * <li>input-file: file:./resource/encoding/latin-ps.txt</li>
* <li>column-number: 2</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingIsoLatin1 extends EncodingVector4a
- implements Serializable {
+public final class EncodingIsoLatin1 extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = -914396846680222158L;
@@ -901,11 +899,6 @@
}
@Override
- public boolean isPredefinedPs() {
- return true;
- }
-
- @Override
public boolean isStatic() {
return true;
}
@@ -924,4 +917,17 @@
return PsEncoding.Predefined.ISO_LATIN_1;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* See PSLRM 3, Table E.1. */
+ return true;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* Not mentioned in PDF Reference 6. However, Section 3.8.1 says "PDFDocEncoding can encode all of the ISO Latin
+ * 1 character set". */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -37,22 +37,22 @@
/**
- * Class containing hard-coded values that represent the MacExpertEncoding
- * Encoding Vector documented at PDF Reference, 5th Edition, Appendix D.2.
+ * Class containing hard-coded values that represent the MacExpertEncoding Encoding Vector documented at PDF Reference,
+ * Sixth Edition, Appendix D.3.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/expert-pdf.txt</li>
+ * <li>input-file: file:./resource/encoding/expert-pdf.txt</li>
* <li>column-number: 1</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingMacExpert extends EncodingVector4a
- implements Serializable {
+public final class EncodingMacExpert extends EncodingVector4a implements Serializable {
+ /* TODO: Can this class reuse the apparently identical values from {@link EncodingExpert}?*/
+
/** Constant needed for serialization. */
public static final long serialVersionUID = -79549852871454145L;
@@ -760,11 +760,6 @@
return EncodingMacExpert.theInstance;
}
- @Override
- public boolean isPredefinedPdf() {
- return true;
- }
-
/**
* {@inheritDoc}
*/
@@ -787,4 +782,17 @@
return PsEncoding.Predefined.MAC_EXPERT;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* Not mentioned in PSLRM 3. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* See PDF Reference 6, Appendix D, where the the first sentence seems to indicate that this Encoding is
+ * predefined in PDF consumer applications. */
+ return true;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -37,21 +37,19 @@
/**
- * Class containing hard-coded values that represent the MacRomanEncoding
- * Encoding Vector documented at PDF Reference, 3rd Edition, Appendix D.1.
+ * Class containing hard-coded values that represent the MacRomanEncoding Encoding Vector documented at PDF Reference,
+ * Sixth Edition, Appendix D.1.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/latin-pdf.txt</li>
+ * <li>input-file: file:./resource/encoding/latin-pdf.txt</li>
* <li>column-number: 2</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingMacRoman extends EncodingVector4a
- implements Serializable {
+public final class EncodingMacRoman extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 993684350470444306L;
@@ -929,11 +927,6 @@
}
@Override
- public boolean isPredefinedPdf() {
- return true;
- }
-
- @Override
public boolean isStatic() {
return true;
}
@@ -952,4 +945,16 @@
return PsEncoding.Predefined.MAC_ROMAN;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* Not mentioned in PSLRM 3. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* See PDF Reference 6, Table D.1. */
+ return true;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -37,27 +37,23 @@
/**
- * Class containing hard-coded values that represent the "standard Macintosh
- * ordering" described in the TrueType font reference material (TTF Reference).
+ * Class containing hard-coded values that represent the "standard Macintosh ordering" described in the TrueType font
+ * reference material (TTF Reference).
* The TTF Reference can be downloaded here:
* http://developer.apple.com/fonts/TTRefMan/RM06/Chap6post.html
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/mac-standard-ttf.txt</li>
+ * <li>input-file: file:./resource/encoding/mac-standard-ttf.txt</li>
* <li>column-number: 1</li>
* <li>radix: 10</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*
- * <p>Note that the glyphs named ".null" and "nonmarkingreturn" do not map
- * to Unicode code points.</p>
+ * <p>Note that the glyphs named ".null" and "nonmarkingreturn" do not map to Unicode code points.</p>
*/
-public final class EncodingMacStandard extends EncodingVector4a
- implements Serializable {
+public final class EncodingMacStandard extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 471516609574396260L;
@@ -1158,4 +1154,16 @@
return PsEncoding.Predefined.STANDARD_MACINTOSH_ORDERING;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* Not mentioned PSLRM 3. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* Not mentionedin PDF Reference 6. */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -37,21 +37,19 @@
/**
- * Class containing hard-coded values that represent the PDFDocEncoding
- * Encoding Vector documented at PDF Reference, 3rd Edition, Appendix D.1.
+ * Class containing hard-coded values that represent the PDFDocEncoding Encoding Vector documented at PDF Reference,
+ * Sixth Edition, Appendix D.1 and D.2.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/latin-pdf.txt</li>
+ * <li>input-file: file:./resource/encoding/latin-pdf.txt</li>
* <li>column-number: 4</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingPdfDoc extends EncodingVector4a
- implements Serializable {
+public final class EncodingPdfDoc extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 749951479927669211L;
@@ -1039,4 +1037,17 @@
return PsEncoding.Predefined.PDF_DOC;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* Not mentioned in PSLRM, Third Edition. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* See PDF Reference, Sixth Edition, Table D.1, which states "PDF does not have a predefined encoding named
+ * PFDDocEncoding; it is not customary to use this encoding to show text from fonts." */
+ return false;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -710,11 +710,18 @@
}
@Override
- public boolean isPredefinedPs() {
+ public boolean isBuiltInPs() {
+ /* See PSLRM 3, Table E.1. */
return true;
}
@Override
+ public boolean isBuiltInPdf() {
+ /* See PDF Reference 6, Table D.1. */
+ return false;
+ }
+
+ @Override
public boolean isStatic() {
return true;
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -37,10 +37,9 @@
/**
- * Class containing hard-coded values that represent the Symbol
- * Encoding Vector documented at PDF Reference, 5th Edition, Appendix D.3.
- * It is identical to that documented at PostScript Language Reference,
- * 3rd Edition, Appendix E.12.
+ * Class containing hard-coded values that represent the Symbol Encoding Vector documented at PDF Reference, Sixth
+ * Edition, Appendix D.4.
+ * It is identical to that documented at PostScript Language Reference, Third Edition, Appendix E.12.
*
* <p>Note that this encoding is not a built-in standard encoding in either
* PostScript or PDF. However, it is built in to the Symbol font, which is a
@@ -58,8 +57,7 @@
* <li>glyph-lists: [null]</li>
* </ol>
*/
-public final class EncodingSymbol extends EncodingVector4a
- implements Serializable {
+public final class EncodingSymbol extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 730497395146140317L;
@@ -883,4 +881,18 @@
return PsEncoding.Predefined.SYMBOL;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* See PSLRM 3, Appendix E, where this Encoding Vector is defined, but where, after Table E.1, it is include
+ * in the list of encoding that "are not defined as named encodings in the PostScript interpreter itself." */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* The "Symbol" font itself is built in, and, although not documented perfectly, the related encoding, used only
+ * for that font, appears to be also, of necessity. */
+ return true;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -314,7 +314,7 @@
@Override
public org.axsl.ps.PsEncoding bestBaseEncodingPdf() {
/* Predefined encodings do not need to be written at all. */
- if (this.isPredefinedPdf()) {
+ if (this.isBuiltInPdf()) {
return null;
}
/* TODO: Write a standard implementation of this that compares this
@@ -400,17 +400,17 @@
this.codePointIndexes2 = (CharArray) stream.readObject();
}
+// @Override
+// public boolean isPredefinedPs() {
+// return false;
+// }
+//
+// @Override
+// public boolean isPredefinedPdf() {
+// return false;
+// }
+//
@Override
- public boolean isPredefinedPs() {
- return false;
- }
-
- @Override
- public boolean isPredefinedPdf() {
- return false;
- }
-
- @Override
public boolean canEncode(final int codePoint) {
return this.encodeCharacter(codePoint) > -1;
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -51,8 +51,7 @@
*
* @see "PDF Reference, Sixth Edition (PDF Version 1.7), Appendix D.1."
*/
-public final class EncodingWinAnsi extends EncodingVector4a
- implements Serializable {
+public final class EncodingWinAnsi extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 136361072507407243L;
@@ -970,11 +969,6 @@
return EncodingWinAnsi.theInstance;
}
- @Override
- public boolean isPredefinedPdf() {
- return true;
- }
-
/**
* Method allowing the ANSI character set to use the same char array as
* this encoding.
@@ -1009,4 +1003,16 @@
return PsEncoding.Predefined.WIN_ANSI;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* Not mentioned in PSLRM 3. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* See PDF Reference 6, Table D.1. */
+ return true;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -40,14 +40,13 @@
/**
- * Class containing hard-coded values that represent the ZapfDingbats
- * Encoding Vector documented at PDF Reference, 5th Edition, Appendix D.4.
+ * Class containing hard-coded values that represent the ZapfDingbats Encoding Vector documented at PDF Reference, Sixth
+ * Edition, Appendix D.5.
*
- * <p>Note that this encoding is not a built-in standard encoding in either
- * PostScript or PDF. However, it is built in to the Symbol font, which is a
- * standard font for both PostScript and PDF. The purpose of this hard-coded
- * encoding is simply to avoid the cost of having to parse that encoding from
- * the font each time it is used.</p>
+ * <p>Note that this encoding is not a built-in standard encoding in either PostScript or PDF.
+ * However, it is built-in to the Zapf Dingbats font, which is a standard font for PDF.
+ * The purpose of this hard-coded encoding is simply to avoid the cost of having to parse that encoding from the font
+ * each time it is used.</p>
*
* <p>The hard-coded values in this class were derived by running
* {@link EncodingParser#main(String[])} with the following input
@@ -59,8 +58,7 @@
* <li>glyph-lists: ZapfDingbats</li>
* </ol>
*/
-public final class EncodingZapfDingbats extends EncodingVector4a
- implements Serializable {
+public final class EncodingZapfDingbats extends EncodingVector4a implements Serializable {
/** Constant needed for serialization. */
public static final long serialVersionUID = 518223961238847383L;
@@ -949,4 +947,17 @@
return PsEncoding.Predefined.ZAPF_DINGBATS;
}
+ @Override
+ public boolean isBuiltInPs() {
+ /* Not mentioned in the PSLRM, Third Edition. */
+ return false;
+ }
+
+ @Override
+ public boolean isBuiltInPdf() {
+ /* The "Zapf Dingbats" font itself is built in, and, although not documented perfectly, the related encoding,
+ * used only for that font, appears to be also, of necessity. */
+ return true;
+ }
+
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-02-06 18:30:34 UTC (rev 11893)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-02-06 22:44:20 UTC (rev 11894)
@@ -413,7 +413,7 @@
/* Except PostScript-native encodings, write each encoding vector. */
for (int i = 0; i < encodingsUsed.size(); i++) {
final PsEncoding vector = encodingsUsed.get(i);
- if (! vector.isPredefinedPs()) {
+ if (! vector.isBuiltInPs()) {
writeRaw(vector.asPostScript(null));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-06 18:30:36
|
Revision: 11893
http://sourceforge.net/p/foray/code/11893
Author: victormote
Date: 2021-02-06 18:30:34 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
Sort non-WinAnsi code points for Helvetica by code point.
Modified Paths:
--------------
trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo 2021-02-06 17:16:51 UTC (rev 11892)
+++ trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo 2021-02-06 18:30:34 UTC (rev 11893)
@@ -23,338 +23,345 @@
<fo:flow flow-name="xsl-region-body" language="eng" country="US">
- <fo:block font-family="Helvetica" font-size="14pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-after=".5em">
Helvetica (WinAnsiEncoding), sorted by Unicode code point.
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Helvetica">
-! <!-- [1] glyph: 0x0021 \041 exclam -->
-" <!-- [2] glyph: 0x0022 \042 quotedbl -->
-# <!-- [3] glyph: 0x0023 \043 numbersign -->
-$ <!-- [4] glyph: 0x0024 \044 dollar -->
-% <!-- [5] glyph: 0x0025 \045 percent -->
-& <!-- [6] glyph: 0x0026 \046 ampersand -->
-' <!-- [7] glyph: 0x0027 \047 quotesingle -->
-( <!-- [8] glyph: 0x0028 \050 parenleft -->
-) <!-- [9] glyph: 0x0029 \051 parenright -->
-* <!-- [10] glyph: 0x002a \052 asterisk -->
-+ <!-- [11] glyph: 0x002b \053 plus -->
-, <!-- [12] glyph: 0x002c \054 comma -->
-- <!-- [13] glyph: 0x002d \055 hyphen -->
-. <!-- [14] glyph: 0x002e \056 period -->
-/ <!-- [15] glyph: 0x002f \057 slash -->
-0 <!-- [16] glyph: 0x0030 \060 zero -->
-1 <!-- [17] glyph: 0x0031 \061 one -->
-2 <!-- [18] glyph: 0x0032 \062 two -->
-3 <!-- [19] glyph: 0x0033 \063 three -->
-4 <!-- [20] glyph: 0x0034 \064 four -->
-5 <!-- [21] glyph: 0x0035 \065 five -->
-6 <!-- [22] glyph: 0x0036 \066 six -->
-7 <!-- [23] glyph: 0x0037 \067 seven -->
-8 <!-- [24] glyph: 0x0038 \070 eight -->
-9 <!-- [25] glyph: 0x0039 \071 nine -->
-: <!-- [26] glyph: 0x003a \072 colon -->
-; <!-- [27] glyph: 0x003b \073 semicolon -->
-< <!-- [28] glyph: 0x003c \074 less -->
-= <!-- [29] glyph: 0x003d \075 equal -->
-> <!-- [30] glyph: 0x003e \076 greater -->
-? <!-- [31] glyph: 0x003f \077 question -->
-@ <!-- [32] glyph: 0x0040 \100 at -->
-A <!-- [33] glyph: 0x0041 \101 A -->
-B <!-- [34] glyph: 0x0042 \102 B -->
-C <!-- [35] glyph: 0x0043 \103 C -->
-D <!-- [36] glyph: 0x0044 \104 D -->
-E <!-- [37] glyph: 0x0045 \105 E -->
-F <!-- [38] glyph: 0x0046 \106 F -->
-G <!-- [39] glyph: 0x0047 \107 G -->
-H <!-- [40] glyph: 0x0048 \110 H -->
-I <!-- [41] glyph: 0x0049 \111 I -->
-J <!-- [42] glyph: 0x004a \112 J -->
-K <!-- [43] glyph: 0x004b \113 K -->
-L <!-- [44] glyph: 0x004c \114 L -->
-M <!-- [45] glyph: 0x004d \115 M -->
-N <!-- [46] glyph: 0x004e \116 N -->
-O <!-- [47] glyph: 0x004f \117 O -->
-P <!-- [48] glyph: 0x0050 \120 P -->
-Q <!-- [49] glyph: 0x0051 \121 Q -->
-R <!-- [50] glyph: 0x0052 \122 R -->
-S <!-- [51] glyph: 0x0053 \123 S -->
-T <!-- [52] glyph: 0x0054 \124 T -->
-U <!-- [53] glyph: 0x0055 \125 U -->
-V <!-- [54] glyph: 0x0056 \126 V -->
-W <!-- [55] glyph: 0x0057 \127 W -->
-X <!-- [56] glyph: 0x0058 \130 X -->
-Y <!-- [57] glyph: 0x0059 \131 Y -->
-Z <!-- [58] glyph: 0x005a \132 Z -->
-[ <!-- [59] glyph: 0x005b \133 bracketleft -->
-\ <!-- [60] glyph: 0x005c \134 backslash -->
-] <!-- [61] glyph: 0x005d \135 bracketright -->
-^ <!-- [62] glyph: 0x005e \136 asciicircum -->
-_ <!-- [63] glyph: 0x005f \137 underscore -->
-` <!-- [64] glyph: 0x0060 \140 grave -->
-a <!-- [65] glyph: 0x0061 \141 a -->
-b <!-- [66] glyph: 0x0062 \142 b -->
-c <!-- [67] glyph: 0x0063 \143 c -->
-d <!-- [68] glyph: 0x0064 \144 d -->
-e <!-- [69] glyph: 0x0065 \145 e -->
-f <!-- [70] glyph: 0x0066 \146 f -->
-g <!-- [71] glyph: 0x0067 \147 g -->
-h <!-- [72] glyph: 0x0068 \150 h -->
-i <!-- [73] glyph: 0x0069 \151 i -->
-j <!-- [74] glyph: 0x006a \152 j -->
-k <!-- [75] glyph: 0x006b \153 k -->
-l <!-- [76] glyph: 0x006c \154 l -->
-m <!-- [77] glyph: 0x006d \155 m -->
-n <!-- [78] glyph: 0x006e \156 n -->
-o <!-- [79] glyph: 0x006f \157 o -->
-p <!-- [80] glyph: 0x0070 \160 p -->
-q <!-- [81] glyph: 0x0071 \161 q -->
-r <!-- [82] glyph: 0x0072 \162 r -->
-s <!-- [83] glyph: 0x0073 \163 s -->
-t <!-- [84] glyph: 0x0074 \164 t -->
-u <!-- [85] glyph: 0x0075 \165 u -->
-v <!-- [86] glyph: 0x0076 \166 v -->
-w <!-- [87] glyph: 0x0077 \167 w -->
-x <!-- [88] glyph: 0x0078 \170 x -->
-y <!-- [89] glyph: 0x0079 \171 y -->
-z <!-- [90] glyph: 0x007a \172 z -->
-{ <!-- [91] glyph: 0x007b \173 braceleft -->
-| <!-- [92] glyph: 0x007c \174 bar -->
-} <!-- [93] glyph: 0x007d \175 braceright -->
-~ <!-- [94] glyph: 0x007e \176 asciitilde -->
-¡ <!-- [95] glyph: 0x00a1 \241 exclamdown -->
-¢ <!-- [96] glyph: 0x00a2 \242 cent -->
-£ <!-- [97] glyph: 0x00a3 \243 sterling -->
-¤ <!-- [98] glyph: 0x00a4 \244 currency -->
-¥ <!-- [99] glyph: 0x00a5 \245 yen -->
-¦ <!-- [100] glyph: 0x00a6 \246 brokenbar -->
-§ <!-- [101] glyph: 0x00a7 \247 section -->
-¨ <!-- [102] glyph: 0x00a8 \250 dieresis -->
-© <!-- [103] glyph: 0x00a9 \251 copyright -->
-ª <!-- [104] glyph: 0x00aa \252 ordfeminine -->
-« <!-- [105] glyph: 0x00ab \253 guillemotleft -->
-¬ <!-- [106] glyph: 0x00ac \254 logicalnot -->
-® <!-- [107] glyph: 0x00ae \256 registered -->
-¯ <!-- [108] glyph: 0x00af \257 macron -->
-° <!-- [109] glyph: 0x00b0 \260 degree -->
-± <!-- [110] glyph: 0x00b1 \261 plusminus -->
-² <!-- [111] glyph: 0x00b2 \262 twosuperior -->
-³ <!-- [112] glyph: 0x00b3 \263 threesuperior -->
-´ <!-- [113] glyph: 0x00b4 \264 acute -->
-µ <!-- [114] glyph: 0x00b5 \265 mu -->
-¶ <!-- [115] glyph: 0x00b6 \266 paragraph -->
-· <!-- [116] glyph: 0x00b7 \267 periodcentered -->
-¸ <!-- [117] glyph: 0x00b8 \270 cedilla -->
-¹ <!-- [118] glyph: 0x00b9 \271 onesuperior -->
-º <!-- [119] glyph: 0x00ba \272 ordmasculine -->
-» <!-- [120] glyph: 0x00bb \273 guillemotright -->
-¼ <!-- [121] glyph: 0x00bc \274 onequarter -->
-½ <!-- [122] glyph: 0x00bd \275 onehalf -->
-¾ <!-- [123] glyph: 0x00be \276 threequarters -->
-¿ <!-- [124] glyph: 0x00bf \277 questiondown -->
-À <!-- [125] glyph: 0x00c0 \300 Agrave -->
-Á <!-- [126] glyph: 0x00c1 \301 Aacute -->
-Â <!-- [127] glyph: 0x00c2 \302 Acircumflex -->
-Ã <!-- [128] glyph: 0x00c3 \303 Atilde -->
-Ä <!-- [129] glyph: 0x00c4 \304 Adieresis -->
-Å <!-- [130] glyph: 0x00c5 \305 Aring -->
-Æ <!-- [131] glyph: 0x00c6 \306 AE -->
-Ç <!-- [132] glyph: 0x00c7 \307 Ccedilla -->
-È <!-- [133] glyph: 0x00c8 \310 Egrave -->
-É <!-- [134] glyph: 0x00c9 \311 Eacute -->
-Ê <!-- [135] glyph: 0x00ca \312 Ecircumflex -->
-Ë <!-- [136] glyph: 0x00cb \313 Edieresis -->
-Ì <!-- [137] glyph: 0x00cc \314 Igrave -->
-Í <!-- [138] glyph: 0x00cd \315 Iacute -->
-Î <!-- [139] glyph: 0x00ce \316 Icircumflex -->
-Ï <!-- [140] glyph: 0x00cf \317 Idieresis -->
-Ð <!-- [141] glyph: 0x00d0 \320 Eth -->
-Ñ <!-- [142] glyph: 0x00d1 \321 Ntilde -->
-Ò <!-- [143] glyph: 0x00d2 \322 Ograve -->
-Ó <!-- [144] glyph: 0x00d3 \323 Oacute -->
-Ô <!-- [145] glyph: 0x00d4 \324 Ocircumflex -->
-Õ <!-- [146] glyph: 0x00d5 \325 Otilde -->
-Ö <!-- [147] glyph: 0x00d6 \326 Odieresis -->
-× <!-- [148] glyph: 0x00d7 \327 multiply -->
-Ø <!-- [149] glyph: 0x00d8 \330 Oslash -->
-Ù <!-- [150] glyph: 0x00d9 \331 Ugrave -->
-Ú <!-- [151] glyph: 0x00da \332 Uacute -->
-Û <!-- [152] glyph: 0x00db \333 Ucircumflex -->
-Ü <!-- [153] glyph: 0x00dc \334 Udieresis -->
-Ý <!-- [154] glyph: 0x00dd \335 Yacute -->
-Þ <!-- [155] glyph: 0x00de \336 Thorn -->
-ß <!-- [156] glyph: 0x00df \337 germandbls -->
-à <!-- [157] glyph: 0x00e0 \340 agrave -->
-á <!-- [158] glyph: 0x00e1 \341 aacute -->
-â <!-- [159] glyph: 0x00e2 \342 acircumflex -->
-ã <!-- [160] glyph: 0x00e3 \343 atilde -->
-ä <!-- [161] glyph: 0x00e4 \344 adieresis -->
-å <!-- [162] glyph: 0x00e5 \345 aring -->
-æ <!-- [163] glyph: 0x00e6 \346 ae -->
-ç <!-- [164] glyph: 0x00e7 \347 ccedilla -->
-è <!-- [165] glyph: 0x00e8 \350 egrave -->
-é <!-- [166] glyph: 0x00e9 \351 eacute -->
-ê <!-- [167] glyph: 0x00ea \352 ecircumflex -->
-ë <!-- [168] glyph: 0x00eb \353 edieresis -->
-ì <!-- [169] glyph: 0x00ec \354 igrave -->
-í <!-- [170] glyph: 0x00ed \355 iacute -->
-î <!-- [171] glyph: 0x00ee \356 icircumflex -->
-ï <!-- [172] glyph: 0x00ef \357 idieresis -->
-ð <!-- [173] glyph: 0x00f0 \360 eth -->
-ñ <!-- [174] glyph: 0x00f1 \361 ntilde -->
-ò <!-- [175] glyph: 0x00f2 \362 ograve -->
-ó <!-- [176] glyph: 0x00f3 \363 oacute -->
-ô <!-- [177] glyph: 0x00f4 \364 ocircumflex -->
-õ <!-- [178] glyph: 0x00f5 \365 otilde -->
-ö <!-- [179] glyph: 0x00f6 \366 odieresis -->
-÷ <!-- [180] glyph: 0x00f7 \367 divide -->
-ø <!-- [181] glyph: 0x00f8 \370 oslash -->
-ù <!-- [182] glyph: 0x00f9 \371 ugrave -->
-ú <!-- [183] glyph: 0x00fa \372 uacute -->
-û <!-- [184] glyph: 0x00fb \373 ucircumflex -->
-ü <!-- [185] glyph: 0x00fc \374 udieresis -->
-ý <!-- [186] glyph: 0x00fd \375 yacute -->
-þ <!-- [187] glyph: 0x00fe \376 thorn -->
-ÿ <!-- [188] glyph: 0x00ff \377 ydieresis -->
-Œ <!-- [189] glyph: 0x008c \214 OE -->
-œ <!-- [190] glyph: 0x009c \234 oe -->
-Š <!-- [191] glyph: 0x008a \212 Scaron -->
-š <!-- [192] glyph: 0x009a \232 scaron -->
-Ÿ <!-- [193] glyph: 0x009f \237 Ydieresis -->
-Ž <!-- [194] glyph: 0x008e \216 Zcaron -->
-ž <!-- [195] glyph: 0x009e \236 zcaron -->
-ƒ <!-- [196] glyph: 0x0083 \203 florin -->
-ˆ <!-- [197] glyph: 0x0088 \210 circumflex -->
-˜ <!-- [198] glyph: 0x0098 \230 tilde -->
-– <!-- [199] glyph: 0x0096 \226 endash -->
-— <!-- [200] glyph: 0x0097 \227 emdash -->
-‘ <!-- [201] glyph: 0x0091 \221 quoteleft -->
-’ <!-- [202] glyph: 0x0092 \222 quoteright -->
-‚ <!-- [203] glyph: 0x0082 \202 quotesinglbase -->
-“ <!-- [204] glyph: 0x0093 \223 quotedblleft -->
-” <!-- [205] glyph: 0x0094 \224 quotedblright -->
-„ <!-- [206] glyph: 0x0084 \204 quotedblbase -->
-† <!-- [207] glyph: 0x0086 \206 dagger -->
-‡ <!-- [208] glyph: 0x0087 \207 daggerdbl -->
-• <!-- [209] glyph: 0x0095 \225 bullet -->
-… <!-- [210] glyph: 0x0085 \205 ellipsis -->
-‰ <!-- [211] glyph: 0x0089 \211 perthousand -->
-‹ <!-- [212] glyph: 0x008b \213 guilsinglleft -->
-› <!-- [213] glyph: 0x009b \233 guilsinglright -->
-€ <!-- [214] glyph: 0x0080 \200 Euro -->
-™ <!-- [215] glyph: 0x0099 \231 trademark -->
+!<!-- [1] glyph: 0x0021 \041 exclam -->
+"<!-- [2] glyph: 0x0022 \042 quotedbl -->
+#<!-- [3] glyph: 0x0023 \043 numbersign -->
+$<!-- [4] glyph: 0x0024 \044 dollar -->
+%<!-- [5] glyph: 0x0025 \045 percent -->
+&<!-- [6] glyph: 0x0026 \046 ampersand -->
+'<!-- [7] glyph: 0x0027 \047 quotesingle -->
+(<!-- [8] glyph: 0x0028 \050 parenleft -->
+)<!-- [9] glyph: 0x0029 \051 parenright -->
+*<!-- [10] glyph: 0x002a \052 asterisk -->
++<!-- [11] glyph: 0x002b \053 plus -->
+,<!-- [12] glyph: 0x002c \054 comma -->
+-<!-- [13] glyph: 0x002d \055 hyphen -->
+.<!-- [14] glyph: 0x002e \056 period -->
+/<!-- [15] glyph: 0x002f \057 slash -->
+0<!-- [16] glyph: 0x0030 \060 zero -->
+1<!-- [17] glyph: 0x0031 \061 one -->
+2<!-- [18] glyph: 0x0032 \062 two -->
+3<!-- [19] glyph: 0x0033 \063 three -->
+4<!-- [20] glyph: 0x0034 \064 four -->
+5<!-- [21] glyph: 0x0035 \065 five -->
+6<!-- [22] glyph: 0x0036 \066 six -->
+7<!-- [23] glyph: 0x0037 \067 seven -->
+8<!-- [24] glyph: 0x0038 \070 eight -->
+9<!-- [25] glyph: 0x0039 \071 nine -->
+:<!-- [26] glyph: 0x003a \072 colon -->
+;<!-- [27] glyph: 0x003b \073 semicolon -->
+<<!-- [28] glyph: 0x003c \074 less -->
+=<!-- [29] glyph: 0x003d \075 equal -->
+><!-- [30] glyph: 0x003e \076 greater -->
+?<!-- [31] glyph: 0x003f \077 question -->
+@<!-- [32] glyph: 0x0040 \100 at -->
+A<!-- [33] glyph: 0x0041 \101 A -->
+B<!-- [34] glyph: 0x0042 \102 B -->
+C<!-- [35] glyph: 0x0043 \103 C -->
+D<!-- [36] glyph: 0x0044 \104 D -->
+E<!-- [37] glyph: 0x0045 \105 E -->
+F<!-- [38] glyph: 0x0046 \106 F -->
+G<!-- [39] glyph: 0x0047 \107 G -->
+H<!-- [40] glyph: 0x0048 \110 H -->
+I<!-- [41] glyph: 0x0049 \111 I -->
+J<!-- [42] glyph: 0x004a \112 J -->
+K<!-- [43] glyph: 0x004b \113 K -->
+L<!-- [44] glyph: 0x004c \114 L -->
+M<!-- [45] glyph: 0x004d \115 M -->
+N<!-- [46] glyph: 0x004e \116 N -->
+O<!-- [47] glyph: 0x004f \117 O -->
+P<!-- [48] glyph: 0x0050 \120 P -->
+Q<!-- [49] glyph: 0x0051 \121 Q -->
+R<!-- [50] glyph: 0x0052 \122 R -->
+S<!-- [51] glyph: 0x0053 \123 S -->
+T<!-- [52] glyph: 0x0054 \124 T -->
+U<!-- [53] glyph: 0x0055 \125 U -->
+V<!-- [54] glyph: 0x0056 \126 V -->
+W<!-- [55] glyph: 0x0057 \127 W -->
+X<!-- [56] glyph: 0x0058 \130 X -->
+Y<!-- [57] glyph: 0x0059 \131 Y -->
+Z<!-- [58] glyph: 0x005a \132 Z -->
+[<!-- [59] glyph: 0x005b \133 bracketleft -->
+\<!-- [60] glyph: 0x005c \134 backslash -->
+]<!-- [61] glyph: 0x005d \135 bracketright -->
+^<!-- [62] glyph: 0x005e \136 asciicircum -->
+_<!-- [63] glyph: 0x005f \137 underscore -->
+`<!-- [64] glyph: 0x0060 \140 grave -->
+a<!-- [65] glyph: 0x0061 \141 a -->
+b<!-- [66] glyph: 0x0062 \142 b -->
+c<!-- [67] glyph: 0x0063 \143 c -->
+d<!-- [68] glyph: 0x0064 \144 d -->
+e<!-- [69] glyph: 0x0065 \145 e -->
+f<!-- [70] glyph: 0x0066 \146 f -->
+g<!-- [71] glyph: 0x0067 \147 g -->
+h<!-- [72] glyph: 0x0068 \150 h -->
+i<!-- [73] glyph: 0x0069 \151 i -->
+j<!-- [74] glyph: 0x006a \152 j -->
+k<!-- [75] glyph: 0x006b \153 k -->
+l<!-- [76] glyph: 0x006c \154 l -->
+m<!-- [77] glyph: 0x006d \155 m -->
+n<!-- [78] glyph: 0x006e \156 n -->
+o<!-- [79] glyph: 0x006f \157 o -->
+p<!-- [80] glyph: 0x0070 \160 p -->
+q<!-- [81] glyph: 0x0071 \161 q -->
+r<!-- [82] glyph: 0x0072 \162 r -->
+s<!-- [83] glyph: 0x0073 \163 s -->
+t<!-- [84] glyph: 0x0074 \164 t -->
+u<!-- [85] glyph: 0x0075 \165 u -->
+v<!-- [86] glyph: 0x0076 \166 v -->
+w<!-- [87] glyph: 0x0077 \167 w -->
+x<!-- [88] glyph: 0x0078 \170 x -->
+y<!-- [89] glyph: 0x0079 \171 y -->
+z<!-- [90] glyph: 0x007a \172 z -->
+{<!-- [91] glyph: 0x007b \173 braceleft -->
+|<!-- [92] glyph: 0x007c \174 bar -->
+}<!-- [93] glyph: 0x007d \175 braceright -->
+~<!-- [94] glyph: 0x007e \176 asciitilde -->
+¡<!-- [95] glyph: 0x00a1 \241 exclamdown -->
+¢<!-- [96] glyph: 0x00a2 \242 cent -->
+£<!-- [97] glyph: 0x00a3 \243 sterling -->
+¤<!-- [98] glyph: 0x00a4 \244 currency -->
+¥<!-- [99] glyph: 0x00a5 \245 yen -->
+¦<!-- [100] glyph: 0x00a6 \246 brokenbar -->
+§<!-- [101] glyph: 0x00a7 \247 section -->
+¨<!-- [102] glyph: 0x00a8 \250 dieresis -->
+©<!-- [103] glyph: 0x00a9 \251 copyright -->
+ª<!-- [104] glyph: 0x00aa \252 ordfeminine -->
+«<!-- [105] glyph: 0x00ab \253 guillemotleft -->
+¬<!-- [106] glyph: 0x00ac \254 logicalnot -->
+®<!-- [107] glyph: 0x00ae \256 registered -->
+¯<!-- [108] glyph: 0x00af \257 macron -->
+°<!-- [109] glyph: 0x00b0 \260 degree -->
+±<!-- [110] glyph: 0x00b1 \261 plusminus -->
+²<!-- [111] glyph: 0x00b2 \262 twosuperior -->
+³<!-- [112] glyph: 0x00b3 \263 threesuperior -->
+´<!-- [113] glyph: 0x00b4 \264 acute -->
+µ<!-- [114] glyph: 0x00b5 \265 mu -->
+¶<!-- [115] glyph: 0x00b6 \266 paragraph -->
+·<!-- [116] glyph: 0x00b7 \267 periodcentered -->
+¸<!-- [117] glyph: 0x00b8 \270 cedilla -->
+¹<!-- [118] glyph: 0x00b9 \271 onesuperior -->
+º<!-- [119] glyph: 0x00ba \272 ordmasculine -->
+»<!-- [120] glyph: 0x00bb \273 guillemotright -->
+¼<!-- [121] glyph: 0x00bc \274 onequarter -->
+½<!-- [122] glyph: 0x00bd \275 onehalf -->
+¾<!-- [123] glyph: 0x00be \276 threequarters -->
+¿<!-- [124] glyph: 0x00bf \277 questiondown -->
+À<!-- [125] glyph: 0x00c0 \300 Agrave -->
+Á<!-- [126] glyph: 0x00c1 \301 Aacute -->
+Â<!-- [127] glyph: 0x00c2 \302 Acircumflex -->
+Ã<!-- [128] glyph: 0x00c3 \303 Atilde -->
+Ä<!-- [129] glyph: 0x00c4 \304 Adieresis -->
+Å<!-- [130] glyph: 0x00c5 \305 Aring -->
+Æ<!-- [131] glyph: 0x00c6 \306 AE -->
+Ç<!-- [132] glyph: 0x00c7 \307 Ccedilla -->
+È<!-- [133] glyph: 0x00c8 \310 Egrave -->
+É<!-- [134] glyph: 0x00c9 \311 Eacute -->
+Ê<!-- [135] glyph: 0x00ca \312 Ecircumflex -->
+Ë<!-- [136] glyph: 0x00cb \313 Edieresis -->
+Ì<!-- [137] glyph: 0x00cc \314 Igrave -->
+Í<!-- [138] glyph: 0x00cd \315 Iacute -->
+Î<!-- [139] glyph: 0x00ce \316 Icircumflex -->
+Ï<!-- [140] glyph: 0x00cf \317 Idieresis -->
+Ð<!-- [141] glyph: 0x00d0 \320 Eth -->
+Ñ<!-- [142] glyph: 0x00d1 \321 Ntilde -->
+Ò<!-- [143] glyph: 0x00d2 \322 Ograve -->
+Ó<!-- [144] glyph: 0x00d3 \323 Oacute -->
+Ô<!-- [145] glyph: 0x00d4 \324 Ocircumflex -->
+Õ<!-- [146] glyph: 0x00d5 \325 Otilde -->
+Ö<!-- [147] glyph: 0x00d6 \326 Odieresis -->
+×<!-- [148] glyph: 0x00d7 \327 multiply -->
+Ø<!-- [149] glyph: 0x00d8 \330 Oslash -->
+Ù<!-- [150] glyph: 0x00d9 \331 Ugrave -->
+Ú<!-- [151] glyph: 0x00da \332 Uacute -->
+Û<!-- [152] glyph: 0x00db \333 Ucircumflex -->
+Ü<!-- [153] glyph: 0x00dc \334 Udieresis -->
+Ý<!-- [154] glyph: 0x00dd \335 Yacute -->
+Þ<!-- [155] glyph: 0x00de \336 Thorn -->
+ß<!-- [156] glyph: 0x00df \337 germandbls -->
+à<!-- [157] glyph: 0x00e0 \340 agrave -->
+á<!-- [158] glyph: 0x00e1 \341 aacute -->
+â<!-- [159] glyph: 0x00e2 \342 acircumflex -->
+ã<!-- [160] glyph: 0x00e3 \343 atilde -->
+ä<!-- [161] glyph: 0x00e4 \344 adieresis -->
+å<!-- [162] glyph: 0x00e5 \345 aring -->
+æ<!-- [163] glyph: 0x00e6 \346 ae -->
+ç<!-- [164] glyph: 0x00e7 \347 ccedilla -->
+è<!-- [165] glyph: 0x00e8 \350 egrave -->
+é<!-- [166] glyph: 0x00e9 \351 eacute -->
+ê<!-- [167] glyph: 0x00ea \352 ecircumflex -->
+ë<!-- [168] glyph: 0x00eb \353 edieresis -->
+ì<!-- [169] glyph: 0x00ec \354 igrave -->
+í<!-- [170] glyph: 0x00ed \355 iacute -->
+î<!-- [171] glyph: 0x00ee \356 icircumflex -->
+ï<!-- [172] glyph: 0x00ef \357 idieresis -->
+ð<!-- [173] glyph: 0x00f0 \360 eth -->
+ñ<!-- [174] glyph: 0x00f1 \361 ntilde -->
+ò<!-- [175] glyph: 0x00f2 \362 ograve -->
+ó<!-- [176] glyph: 0x00f3 \363 oacute -->
+ô<!-- [177] glyph: 0x00f4 \364 ocircumflex -->
+õ<!-- [178] glyph: 0x00f5 \365 otilde -->
+ö<!-- [179] glyph: 0x00f6 \366 odieresis -->
+÷<!-- [180] glyph: 0x00f7 \367 divide -->
+ø<!-- [181] glyph: 0x00f8 \370 oslash -->
+ù<!-- [182] glyph: 0x00f9 \371 ugrave -->
+ú<!-- [183] glyph: 0x00fa \372 uacute -->
+û<!-- [184] glyph: 0x00fb \373 ucircumflex -->
+ü<!-- [185] glyph: 0x00fc \374 udieresis -->
+ý<!-- [186] glyph: 0x00fd \375 yacute -->
+þ<!-- [187] glyph: 0x00fe \376 thorn -->
+ÿ<!-- [188] glyph: 0x00ff \377 ydieresis -->
+Œ<!-- [189] glyph: 0x008c \214 OE -->
+œ<!-- [190] glyph: 0x009c \234 oe -->
+Š<!-- [191] glyph: 0x008a \212 Scaron -->
+š<!-- [192] glyph: 0x009a \232 scaron -->
+Ÿ<!-- [193] glyph: 0x009f \237 Ydieresis -->
+Ž<!-- [194] glyph: 0x008e \216 Zcaron -->
+ž<!-- [195] glyph: 0x009e \236 zcaron -->
+ƒ<!-- [196] glyph: 0x0083 \203 florin -->
+ˆ<!-- [197] glyph: 0x0088 \210 circumflex -->
+˜<!-- [198] glyph: 0x0098 \230 tilde -->
+–<!-- [199] glyph: 0x0096 \226 endash -->
+—<!-- [200] glyph: 0x0097 \227 emdash -->
+‘<!-- [201] glyph: 0x0091 \221 quoteleft -->
+’<!-- [202] glyph: 0x0092 \222 quoteright -->
+‚<!-- [203] glyph: 0x0082 \202 quotesinglbase -->
+“<!-- [204] glyph: 0x0093 \223 quotedblleft -->
+”<!-- [205] glyph: 0x0094 \224 quotedblright -->
+„<!-- [206] glyph: 0x0084 \204 quotedblbase -->
+†<!-- [207] glyph: 0x0086 \206 dagger -->
+‡<!-- [208] glyph: 0x0087 \207 daggerdbl -->
+•<!-- [209] glyph: 0x0095 \225 bullet -->
+…<!-- [210] glyph: 0x0085 \205 ellipsis -->
+‰<!-- [211] glyph: 0x0089 \211 perthousand -->
+‹<!-- [212] glyph: 0x008b \213 guilsinglleft -->
+›<!-- [213] glyph: 0x009b \233 guilsinglright -->
+€<!-- [214] glyph: 0x0080 \200 Euro -->
+™<!-- [215] glyph: 0x0099 \231 trademark -->
<!-- 216 total, including "space" which was not specifically called out. -->
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt">
-Helvetica (Other Glyphs)
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-after=".5em">
+Helvetica (Other Glyphs), sorted by Unicode code point.
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Helvetica">
-<!-- Abreve -->Ă
-<!-- Amacron -->Ā
-<!-- Aogonek -->Ą
-<!-- Cacute -->Ć
-<!-- Ccaron -->Č
-<!-- Dcaron -->Ď
-<!-- Dcroat -->Đ
-<!-- Delta -->∆
-<!-- Ecaron -->Ě
-<!-- Edotaccent -->Ė
-<!-- Emacron -->Ē
-<!-- Eogonek -->Ę
-<!-- Gbreve -->Ğ
-<!-- Gcommaaccent -->Ģ
-<!-- Idotaccent -->İ
-<!-- Imacron -->Ī
-<!-- Iogonek -->Į
-<!-- Kcommaaccent -->Ķ
-<!-- Lacute -->Ĺ
-<!-- Lcaron -->Ľ
-<!-- Lcommaaccent -->Ļ
-<!-- Lslash -->Ł
-<!-- Nacute -->Ń
-<!-- Ncaron -->Ň
-<!-- Ncommaaccent -->Ņ
-<!-- Ohungarumlaut -->Ő
-<!-- Omacron -->Ō
-<!-- Racute -->Ŕ
-<!-- Rcaron -->Ř
-<!-- Rcommaaccent -->Ŗ
-<!-- Sacute -->Ś
-<!-- Scedilla -->Ş
-<!-- Scommaaccent -->Ș
-<!-- Tcaron -->Ť
-<!-- Tcommaaccent -->Ţ
-<!-- Uhungarumlaut -->Ű
-<!-- Umacron -->Ū
-<!-- Uogonek -->Ų
-<!-- Uring -->Ů
-<!-- Zacute -->Ź
-<!-- Zdotaccent -->Ż
-<!-- abreve -->ă
-<!-- amacron -->ā
-<!-- aogonek -->ą
-<!-- breve -->˘
-<!-- cacute -->ć
-<!-- caron -->ˇ
-<!-- ccaron -->č
-<!-- commaaccent -->
-<!-- dcaron -->ď
-<!-- dcroat -->đ
-<!-- dotaccent -->˙
-<!-- dotlessi -->ı
-<!-- ecaron -->ě
-<!-- edotaccent -->ė
-<!-- emacron -->ē
-<!-- eogonek -->ę
-<!-- fi -->fi
-<!-- fl -->fl
-<!-- fraction -->⁄
-<!-- gbreve -->ğ
-<!-- gcommaaccent -->ģ
-<!-- greaterequal -->≥
-<!-- hungarumlaut -->˝
-<!-- imacron -->ī
-<!-- iogonek -->į
-<!-- kcommaaccent -->ķ
-<!-- lacute -->ĺ
-<!-- lcaron -->ľ
-<!-- lcommaaccent -->ļ
-<!-- lessequal -->≤
-<!-- lozenge -->◊
-<!-- lslash -->ł
-<!-- minus -->−
-<!-- nacute -->ń
-<!-- ncaron -->ň
-<!-- ncommaaccent -->ņ
-<!-- notequal -->≠
-<!-- ogonek -->˛
-<!-- ohungarumlaut -->ő
-<!-- omacron -->ō
-<!-- partialdiff -->∂
-<!-- racute -->ŕ
-<!-- radical -->√
-<!-- rcaron -->ř
-<!-- rcommaaccent -->ŗ
-<!-- ring -->˚
-<!-- sacute -->ś
-<!-- scedilla -->ş
-<!-- scommaaccent -->ș
-<!-- summation -->∑
-<!-- tcaron -->ť
-<!-- tcommaaccent -->ţ
-<!-- uhungarumlaut -->ű
-<!-- umacron -->ū
-<!-- uogonek -->ų
-<!-- uring -->ů
-<!-- zacute -->ź
-<!-- zdotaccent -->ż
+Ā<!-- Amacron -->
+ā<!-- amacron -->
+Ă<!-- Abreve -->
+ă<!-- abreve -->
+Ą<!-- Aogonek -->
+ą<!-- aogonek -->
+Ć<!-- Cacute -->
+ć<!-- cacute -->
+Č<!-- Ccaron -->
+č<!-- ccaron -->
+Ď<!-- Dcaron -->
+ď<!-- dcaron -->
+Đ<!-- Dcroat -->
+đ<!-- dcroat -->
+Ē<!-- Emacron -->
+ē<!-- emacron -->
+Ė<!-- Edotaccent -->
+ė<!-- edotaccent -->
+Ę<!-- Eogonek -->
+ę<!-- eogonek -->
+Ě<!-- Ecaron -->
+ě<!-- ecaron -->
+Ğ<!-- Gbreve -->
+ğ<!-- gbreve -->
+Ģ<!-- Gcommaaccent -->
+ģ<!-- gcommaaccent -->
+Ī<!-- Imacron -->
+ī<!-- imacron -->
+Į<!-- Iogonek -->
+į<!-- iogonek -->
+İ<!-- Idotaccent -->
+ı<!-- dotlessi -->
+Ķ<!-- Kcommaaccent -->
+ķ<!-- kcommaaccent -->
+Ĺ<!-- Lacute -->
+ĺ<!-- lacute -->
+Ļ<!-- Lcommaaccent -->
+ļ<!-- lcommaaccent -->
+Ľ<!-- Lcaron -->
+ľ<!-- lcaron -->
+Ł<!-- Lslash -->
+ł<!-- lslash -->
+Ń<!-- Nacute -->
+ń<!-- nacute -->
+Ņ<!-- Ncommaaccent -->
+ņ<!-- ncommaaccent -->
+Ň<!-- Ncaron -->
+ň<!-- ncaron -->
+Ō<!-- Omacron -->
+ō<!-- omacron -->
+Ő<!-- Ohungarumlaut -->
+ő<!-- ohungarumlaut -->
+Ŕ<!-- Racute -->
+ŕ<!-- racute -->
+Ŗ<!-- Rcommaaccent -->
+ŗ<!-- rcommaaccent -->
+Ř<!-- Rcaron -->
+ř<!-- rcaron -->
+Ś<!-- Sacute -->
+ś<!-- sacute -->
+Ş<!-- Scedilla -->
+ş<!-- scedilla -->
+Ţ<!-- Tcommaaccent -->
+ţ<!-- tcommaaccent -->
+Ť<!-- Tcaron -->
+ť<!-- tcaron -->
+Ū<!-- Umacron -->
+ū<!-- umacron -->
+Ů<!-- Uring -->
+ů<!-- uring -->
+Ű<!-- Uhungarumlaut -->
+ű<!-- uhungarumlaut -->
+Ų<!-- Uogonek -->
+ų<!-- uogonek -->
+Ź<!-- Zacute -->
+ź<!-- zacute -->
+Ż<!-- Zdotaccent -->
+ż<!-- zdotaccent -->
+Ș<!-- Scommaaccent -->
+ș<!-- scommaaccent -->
+ˇ<!-- caron -->
+˘<!-- breve -->
+˙<!-- dotaccent -->
+˚<!-- ring -->
+˛<!-- ogonek -->
+˝<!-- hungarumlaut -->
+⁄<!-- fraction -->
+∂<!-- partialdiff -->
+∆<!-- Delta -->
+∑<!-- summation -->
+−<!-- minus -->
+√<!-- radical -->
+≠<!-- notequal -->
+≤<!-- lessequal -->
+≥<!-- greaterequal -->
+◊<!-- lozenge -->
+<!-- commaaccent -->
+fi<!-- fi -->
+fl<!-- fl -->
+
<!-- 99 Total -->
<!-- Total glyphs accounted for = 216 + 99 = 315.
Total glyphs in font = 315. -->
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt">
+
+
+
+
+
+
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
Times Roman (WinAnsiEncoding)
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Times Roman">
@@ -383,7 +390,7 @@
€ ™
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
Courier (WinAnsiEncoding)
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Courier">
@@ -412,7 +419,7 @@
€ ™
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
ZapfDingbats
</fo:block>
<fo:block space-after.optimum="10pt" font-family="ZapfDingbats">
@@ -447,7 +454,7 @@
    
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
ZapfDingbats (not listed in ZapfDingbats Encoding, PDF Reference, 3rd
Edition, Appendix D.4)
</fo:block>
@@ -468,7 +475,7 @@
<!-- a96 --> ❵
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
Symbol
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Symbol">
@@ -663,7 +670,7 @@
</fo:block>
- <fo:block font-family="Helvetica" font-size="12pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="12pt">
Different font sizes:
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Helvetica">
@@ -933,7 +940,7 @@
properly.</fo:inline>
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt" space-before.optimum="12pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-before.optimum="12pt">
Unicode Secondary Multilingual Plane (SMP), aka Plane One
</fo:block>
@@ -989,7 +996,7 @@
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt" space-before.optimum="12pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-before.optimum="12pt">
Combining Diacriticals
</fo:block>
@@ -1013,7 +1020,7 @@
a͡b</fo:block>
<fo:block font-family="otf-combining-diacriticals-latin">An m-dot-below, used in Marshallese: ṃ</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt" space-before.optimum="12pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-before.optimum="12pt">
Hebrew
</fo:block>
<fo:block font-family="serif" space-after.optimum="12pt">The following paragraph is set in Hebrew for the purposes
@@ -1038,7 +1045,7 @@
תיִׁ֖שאֵרְּב
</fo:block>
- <fo:block font-family="Helvetica" font-size="14pt" space-before.optimum="12pt">
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-before.optimum="12pt">
Ligatures
</fo:block>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-06 17:16:54
|
Revision: 11892
http://sourceforge.net/p/foray/code/11892
Author: victormote
Date: 2021-02-06 17:16:51 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
Fix bug in FontUse4a regarding whether a FontUse4a is able to encode a given code point.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-02-06 16:03:08 UTC (rev 11891)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-02-06 17:16:51 UTC (rev 11892)
@@ -167,15 +167,13 @@
}
/**
- * Select a font use based on the registered font description and a Unicode
- * code point.
+ * Select a font use based on the registered font description and a Unicode code point.
* @param rfd The font description that should be used for the selection.
* @param codePoint The Unicode code point that should be encodable by the
* returned font use.
* @return The best font use.
*/
- public FontUse4a selectFontUse(final RegisteredFontFamilyMember rfd,
- final int codePoint) {
+ public FontUse4a selectFontUse(final RegisteredFontFamilyMember rfd, final int codePoint) {
if (rfd == null) {
return null;
}
@@ -203,6 +201,7 @@
if (fontUse != null) {
return fontUse;
}
+
/* If none already exists, create one. */
if (sf != null) {
/* We don't care about encodings for SystemFonts. */
@@ -274,26 +273,23 @@
private Encoding getBestEncoding(final int codePoint) {
Encoding trialEncoding = null;
final Encoding internalEncoding = this.font.getInternalEncoding();
- if (internalEncoding.canEncode(codePoint)) {
- return internalEncoding;
- }
-
-
-
+ /* Cmap encodings should be able to handle any character in the font's character set. */
if (! (internalEncoding instanceof PsEncoding)) {
- /* Cmap4a encodings should be able to handle any character in the
- * font's character set. */
return internalEncoding;
}
+
/* Cast checked above. */
final PsEncoding internalEncodingVector = (PsEncoding) internalEncoding;
+
+
+ /* The specialized encodings cover their entire character set. */
if (internalEncodingVector.getPredefinedType() == PsEncoding.Predefined.SYMBOL
|| internalEncodingVector.getPredefinedType() == PsEncoding.Predefined.ZAPF_DINGBATS) {
- /* The specialized encodings cover their entire character set. */
return internalEncoding;
}
+
if (internalEncodingVector.getPredefinedType() == PsEncoding.Predefined.STANDARD) {
final PsServer psServer = this.getFontConsumer().getFontServer().getPsServer();
/* Try WinAnsiEncoding. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2021-02-06 16:03:08 UTC (rev 11891)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2021-02-06 17:16:51 UTC (rev 11892)
@@ -314,21 +314,18 @@
}
/**
- * For a given RegisteredFontDesc instance known to be able to encode a
- * given Unicode codepoint, return a FontUse that will do exactly that.
- * @param fontDescSelected The font description which is known to be able to
- * encode {@code codepoint}.
+ * For a given RegisteredFontDesc instance known to be able to encode a given Unicode codepoint, return a FontUse
+ * that will do exactly that.
+ * @param fontDescSelected The font description which is known to be able to encode {@code codepoint}.
* @param codePoint The codepoint to be encoded.
* @return The FontUse that should be used.
* @throws FontException For errors in font selection.
*/
- private org.axsl.font.FontUse getFontUse(
- final RegisteredFontFamilyMember fontDescSelected, final int codePoint)
+ private org.axsl.font.FontUse getFontUse(final RegisteredFontFamilyMember fontDescSelected, final int codePoint)
throws FontException {
Font4a fontSelected = null;
if (fontDescSelected != null) {
- fontSelected = whichUse(fontDescSelected,
- codePoint);
+ fontSelected = whichUse(fontDescSelected, codePoint);
}
if (fontSelected == null) {
/* None of the requested font-family items can provide a suitable
@@ -342,8 +339,7 @@
}
final ConsumerFont4a consumerFont = registerFontUse(fontSelected);
/* Selection of the actual FontUse is delegated to consumerFont. */
- final FontUse4a fontUse = consumerFont.selectFontUse(
- fontDescSelected, codePoint);
+ final FontUse4a fontUse = consumerFont.selectFontUse(fontDescSelected, codePoint);
return fontUse;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-02-06 16:03:08 UTC (rev 11891)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-02-06 17:16:51 UTC (rev 11892)
@@ -300,8 +300,7 @@
return true;
}
/* Can my encoding encode it? */
- final int encodedChar = this.encoding.encodeCharacter(codePoint);
- return encodedChar != 0;
+ return this.encoding.canEncode(codePoint);
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2021-02-06 16:03:08 UTC (rev 11891)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2021-02-06 17:16:51 UTC (rev 11892)
@@ -396,8 +396,7 @@
if (Character.isSupplementaryCodePoint(codePoint)) {
i++;
}
- final FontUse newFont = whichFont(area, primaryFont, currentFont,
- codePoint);
+ final FontUse newFont = whichFont(area, primaryFont, currentFont, codePoint);
if (newFont != currentFont) {
/* Font has changed. Write the text so far. */
final int size = i - startIndex;
@@ -425,16 +424,15 @@
* @param c The next character to be written.
* @return The appropriate font to use.
*/
- private FontUse whichFont(final TextArea area,
- final FontUse primaryFont, final FontUse currentFont, final int c) {
- /* Trying to avoid unnecessary font selection work on the one hand, and
- * unnecessary switching between fonts in the output on the other.*/
+ private FontUse whichFont(final TextArea area, final FontUse primaryFont, final FontUse currentFont, final int c) {
+ /* Trying to avoid unnecessary font selection work on the one hand, and unnecessary switching between fonts in
+ * the output on the other.*/
/* Current font is the primary font & can paint the glyph. No change.
* This should be the normal case. */
if (primaryFont == currentFont
&& primaryFont.glyphAvailable(c)) {
- return currentFont;
+ return currentFont;
}
/* If the two fonts are really the same font, don't change. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-06 16:03:09
|
Revision: 11891
http://sourceforge.net/p/foray/code/11891
Author: victormote
Date: 2021-02-06 16:03:08 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
Use new WinAnsiEncoding comments to track glyphs better.
Modified Paths:
--------------
trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo 2021-02-06 14:58:27 UTC (rev 11890)
+++ trunk/foray/master/dist/resource/fo-examples/basic/fonts.fo 2021-02-06 16:03:08 UTC (rev 11891)
@@ -24,33 +24,225 @@
<fo:flow flow-name="xsl-region-body" language="eng" country="US">
<fo:block font-family="Helvetica" font-size="14pt">
-Helvetica (WinAnsiEncoding)
+Helvetica (WinAnsiEncoding), sorted by Unicode code point.
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Helvetica">
-! " # $ % & ' ( ) *
-+ , - . / 0 1 2 3 4
-5 6 7 8 9 : ; < = >
-? @ A B C D E F G H
-I J K L M N O P Q R
-S T U V W X Y Z [ \
-] ^ _ ` a b c d e f
-g h i j k l m n o p
-q r s t u v w x y z
-{ | } ~ ¡ ¢ £ ¤ ¥ ¦
-§ ¨ © ª « ¬ ® ¯ ° ±
-² ³ ´ µ ¶ · ¸ ¹ º »
-¼ ½ ¾ ¿ À Á Â Ã Ä Å
-Æ Ç È É Ê Ë Ì Í Î Ï
-Ð Ñ Ò Ó Ô Õ Ö × Ø Ù
-Ú Û Ü Ý Þ ß à á â ã
-ä å æ ç è é ê ë ì í
-î ï ð ñ ò ó ô õ ö ÷
-ø ù ú û ü ý þ ÿ
-Œ œ Š š Ÿ Ž ž ƒ
-˜ – — ‘ ’ ‚ “ ”
-„ † ‡ • … ‰ ‹ ›
-€ ™
-<!-- 214 total + space = 215 -->
+! <!-- [1] glyph: 0x0021 \041 exclam -->
+" <!-- [2] glyph: 0x0022 \042 quotedbl -->
+# <!-- [3] glyph: 0x0023 \043 numbersign -->
+$ <!-- [4] glyph: 0x0024 \044 dollar -->
+% <!-- [5] glyph: 0x0025 \045 percent -->
+& <!-- [6] glyph: 0x0026 \046 ampersand -->
+' <!-- [7] glyph: 0x0027 \047 quotesingle -->
+( <!-- [8] glyph: 0x0028 \050 parenleft -->
+) <!-- [9] glyph: 0x0029 \051 parenright -->
+* <!-- [10] glyph: 0x002a \052 asterisk -->
++ <!-- [11] glyph: 0x002b \053 plus -->
+, <!-- [12] glyph: 0x002c \054 comma -->
+- <!-- [13] glyph: 0x002d \055 hyphen -->
+. <!-- [14] glyph: 0x002e \056 period -->
+/ <!-- [15] glyph: 0x002f \057 slash -->
+0 <!-- [16] glyph: 0x0030 \060 zero -->
+1 <!-- [17] glyph: 0x0031 \061 one -->
+2 <!-- [18] glyph: 0x0032 \062 two -->
+3 <!-- [19] glyph: 0x0033 \063 three -->
+4 <!-- [20] glyph: 0x0034 \064 four -->
+5 <!-- [21] glyph: 0x0035 \065 five -->
+6 <!-- [22] glyph: 0x0036 \066 six -->
+7 <!-- [23] glyph: 0x0037 \067 seven -->
+8 <!-- [24] glyph: 0x0038 \070 eight -->
+9 <!-- [25] glyph: 0x0039 \071 nine -->
+: <!-- [26] glyph: 0x003a \072 colon -->
+; <!-- [27] glyph: 0x003b \073 semicolon -->
+< <!-- [28] glyph: 0x003c \074 less -->
+= <!-- [29] glyph: 0x003d \075 equal -->
+> <!-- [30] glyph: 0x003e \076 greater -->
+? <!-- [31] glyph: 0x003f \077 question -->
+@ <!-- [32] glyph: 0x0040 \100 at -->
+A <!-- [33] glyph: 0x0041 \101 A -->
+B <!-- [34] glyph: 0x0042 \102 B -->
+C <!-- [35] glyph: 0x0043 \103 C -->
+D <!-- [36] glyph: 0x0044 \104 D -->
+E <!-- [37] glyph: 0x0045 \105 E -->
+F <!-- [38] glyph: 0x0046 \106 F -->
+G <!-- [39] glyph: 0x0047 \107 G -->
+H <!-- [40] glyph: 0x0048 \110 H -->
+I <!-- [41] glyph: 0x0049 \111 I -->
+J <!-- [42] glyph: 0x004a \112 J -->
+K <!-- [43] glyph: 0x004b \113 K -->
+L <!-- [44] glyph: 0x004c \114 L -->
+M <!-- [45] glyph: 0x004d \115 M -->
+N <!-- [46] glyph: 0x004e \116 N -->
+O <!-- [47] glyph: 0x004f \117 O -->
+P <!-- [48] glyph: 0x0050 \120 P -->
+Q <!-- [49] glyph: 0x0051 \121 Q -->
+R <!-- [50] glyph: 0x0052 \122 R -->
+S <!-- [51] glyph: 0x0053 \123 S -->
+T <!-- [52] glyph: 0x0054 \124 T -->
+U <!-- [53] glyph: 0x0055 \125 U -->
+V <!-- [54] glyph: 0x0056 \126 V -->
+W <!-- [55] glyph: 0x0057 \127 W -->
+X <!-- [56] glyph: 0x0058 \130 X -->
+Y <!-- [57] glyph: 0x0059 \131 Y -->
+Z <!-- [58] glyph: 0x005a \132 Z -->
+[ <!-- [59] glyph: 0x005b \133 bracketleft -->
+\ <!-- [60] glyph: 0x005c \134 backslash -->
+] <!-- [61] glyph: 0x005d \135 bracketright -->
+^ <!-- [62] glyph: 0x005e \136 asciicircum -->
+_ <!-- [63] glyph: 0x005f \137 underscore -->
+` <!-- [64] glyph: 0x0060 \140 grave -->
+a <!-- [65] glyph: 0x0061 \141 a -->
+b <!-- [66] glyph: 0x0062 \142 b -->
+c <!-- [67] glyph: 0x0063 \143 c -->
+d <!-- [68] glyph: 0x0064 \144 d -->
+e <!-- [69] glyph: 0x0065 \145 e -->
+f <!-- [70] glyph: 0x0066 \146 f -->
+g <!-- [71] glyph: 0x0067 \147 g -->
+h <!-- [72] glyph: 0x0068 \150 h -->
+i <!-- [73] glyph: 0x0069 \151 i -->
+j <!-- [74] glyph: 0x006a \152 j -->
+k <!-- [75] glyph: 0x006b \153 k -->
+l <!-- [76] glyph: 0x006c \154 l -->
+m <!-- [77] glyph: 0x006d \155 m -->
+n <!-- [78] glyph: 0x006e \156 n -->
+o <!-- [79] glyph: 0x006f \157 o -->
+p <!-- [80] glyph: 0x0070 \160 p -->
+q <!-- [81] glyph: 0x0071 \161 q -->
+r <!-- [82] glyph: 0x0072 \162 r -->
+s <!-- [83] glyph: 0x0073 \163 s -->
+t <!-- [84] glyph: 0x0074 \164 t -->
+u <!-- [85] glyph: 0x0075 \165 u -->
+v <!-- [86] glyph: 0x0076 \166 v -->
+w <!-- [87] glyph: 0x0077 \167 w -->
+x <!-- [88] glyph: 0x0078 \170 x -->
+y <!-- [89] glyph: 0x0079 \171 y -->
+z <!-- [90] glyph: 0x007a \172 z -->
+{ <!-- [91] glyph: 0x007b \173 braceleft -->
+| <!-- [92] glyph: 0x007c \174 bar -->
+} <!-- [93] glyph: 0x007d \175 braceright -->
+~ <!-- [94] glyph: 0x007e \176 asciitilde -->
+¡ <!-- [95] glyph: 0x00a1 \241 exclamdown -->
+¢ <!-- [96] glyph: 0x00a2 \242 cent -->
+£ <!-- [97] glyph: 0x00a3 \243 sterling -->
+¤ <!-- [98] glyph: 0x00a4 \244 currency -->
+¥ <!-- [99] glyph: 0x00a5 \245 yen -->
+¦ <!-- [100] glyph: 0x00a6 \246 brokenbar -->
+§ <!-- [101] glyph: 0x00a7 \247 section -->
+¨ <!-- [102] glyph: 0x00a8 \250 dieresis -->
+© <!-- [103] glyph: 0x00a9 \251 copyright -->
+ª <!-- [104] glyph: 0x00aa \252 ordfeminine -->
+« <!-- [105] glyph: 0x00ab \253 guillemotleft -->
+¬ <!-- [106] glyph: 0x00ac \254 logicalnot -->
+® <!-- [107] glyph: 0x00ae \256 registered -->
+¯ <!-- [108] glyph: 0x00af \257 macron -->
+° <!-- [109] glyph: 0x00b0 \260 degree -->
+± <!-- [110] glyph: 0x00b1 \261 plusminus -->
+² <!-- [111] glyph: 0x00b2 \262 twosuperior -->
+³ <!-- [112] glyph: 0x00b3 \263 threesuperior -->
+´ <!-- [113] glyph: 0x00b4 \264 acute -->
+µ <!-- [114] glyph: 0x00b5 \265 mu -->
+¶ <!-- [115] glyph: 0x00b6 \266 paragraph -->
+· <!-- [116] glyph: 0x00b7 \267 periodcentered -->
+¸ <!-- [117] glyph: 0x00b8 \270 cedilla -->
+¹ <!-- [118] glyph: 0x00b9 \271 onesuperior -->
+º <!-- [119] glyph: 0x00ba \272 ordmasculine -->
+» <!-- [120] glyph: 0x00bb \273 guillemotright -->
+¼ <!-- [121] glyph: 0x00bc \274 onequarter -->
+½ <!-- [122] glyph: 0x00bd \275 onehalf -->
+¾ <!-- [123] glyph: 0x00be \276 threequarters -->
+¿ <!-- [124] glyph: 0x00bf \277 questiondown -->
+À <!-- [125] glyph: 0x00c0 \300 Agrave -->
+Á <!-- [126] glyph: 0x00c1 \301 Aacute -->
+Â <!-- [127] glyph: 0x00c2 \302 Acircumflex -->
+Ã <!-- [128] glyph: 0x00c3 \303 Atilde -->
+Ä <!-- [129] glyph: 0x00c4 \304 Adieresis -->
+Å <!-- [130] glyph: 0x00c5 \305 Aring -->
+Æ <!-- [131] glyph: 0x00c6 \306 AE -->
+Ç <!-- [132] glyph: 0x00c7 \307 Ccedilla -->
+È <!-- [133] glyph: 0x00c8 \310 Egrave -->
+É <!-- [134] glyph: 0x00c9 \311 Eacute -->
+Ê <!-- [135] glyph: 0x00ca \312 Ecircumflex -->
+Ë <!-- [136] glyph: 0x00cb \313 Edieresis -->
+Ì <!-- [137] glyph: 0x00cc \314 Igrave -->
+Í <!-- [138] glyph: 0x00cd \315 Iacute -->
+Î <!-- [139] glyph: 0x00ce \316 Icircumflex -->
+Ï <!-- [140] glyph: 0x00cf \317 Idieresis -->
+Ð <!-- [141] glyph: 0x00d0 \320 Eth -->
+Ñ <!-- [142] glyph: 0x00d1 \321 Ntilde -->
+Ò <!-- [143] glyph: 0x00d2 \322 Ograve -->
+Ó <!-- [144] glyph: 0x00d3 \323 Oacute -->
+Ô <!-- [145] glyph: 0x00d4 \324 Ocircumflex -->
+Õ <!-- [146] glyph: 0x00d5 \325 Otilde -->
+Ö <!-- [147] glyph: 0x00d6 \326 Odieresis -->
+× <!-- [148] glyph: 0x00d7 \327 multiply -->
+Ø <!-- [149] glyph: 0x00d8 \330 Oslash -->
+Ù <!-- [150] glyph: 0x00d9 \331 Ugrave -->
+Ú <!-- [151] glyph: 0x00da \332 Uacute -->
+Û <!-- [152] glyph: 0x00db \333 Ucircumflex -->
+Ü <!-- [153] glyph: 0x00dc \334 Udieresis -->
+Ý <!-- [154] glyph: 0x00dd \335 Yacute -->
+Þ <!-- [155] glyph: 0x00de \336 Thorn -->
+ß <!-- [156] glyph: 0x00df \337 germandbls -->
+à <!-- [157] glyph: 0x00e0 \340 agrave -->
+á <!-- [158] glyph: 0x00e1 \341 aacute -->
+â <!-- [159] glyph: 0x00e2 \342 acircumflex -->
+ã <!-- [160] glyph: 0x00e3 \343 atilde -->
+ä <!-- [161] glyph: 0x00e4 \344 adieresis -->
+å <!-- [162] glyph: 0x00e5 \345 aring -->
+æ <!-- [163] glyph: 0x00e6 \346 ae -->
+ç <!-- [164] glyph: 0x00e7 \347 ccedilla -->
+è <!-- [165] glyph: 0x00e8 \350 egrave -->
+é <!-- [166] glyph: 0x00e9 \351 eacute -->
+ê <!-- [167] glyph: 0x00ea \352 ecircumflex -->
+ë <!-- [168] glyph: 0x00eb \353 edieresis -->
+ì <!-- [169] glyph: 0x00ec \354 igrave -->
+í <!-- [170] glyph: 0x00ed \355 iacute -->
+î <!-- [171] glyph: 0x00ee \356 icircumflex -->
+ï <!-- [172] glyph: 0x00ef \357 idieresis -->
+ð <!-- [173] glyph: 0x00f0 \360 eth -->
+ñ <!-- [174] glyph: 0x00f1 \361 ntilde -->
+ò <!-- [175] glyph: 0x00f2 \362 ograve -->
+ó <!-- [176] glyph: 0x00f3 \363 oacute -->
+ô <!-- [177] glyph: 0x00f4 \364 ocircumflex -->
+õ <!-- [178] glyph: 0x00f5 \365 otilde -->
+ö <!-- [179] glyph: 0x00f6 \366 odieresis -->
+÷ <!-- [180] glyph: 0x00f7 \367 divide -->
+ø <!-- [181] glyph: 0x00f8 \370 oslash -->
+ù <!-- [182] glyph: 0x00f9 \371 ugrave -->
+ú <!-- [183] glyph: 0x00fa \372 uacute -->
+û <!-- [184] glyph: 0x00fb \373 ucircumflex -->
+ü <!-- [185] glyph: 0x00fc \374 udieresis -->
+ý <!-- [186] glyph: 0x00fd \375 yacute -->
+þ <!-- [187] glyph: 0x00fe \376 thorn -->
+ÿ <!-- [188] glyph: 0x00ff \377 ydieresis -->
+Œ <!-- [189] glyph: 0x008c \214 OE -->
+œ <!-- [190] glyph: 0x009c \234 oe -->
+Š <!-- [191] glyph: 0x008a \212 Scaron -->
+š <!-- [192] glyph: 0x009a \232 scaron -->
+Ÿ <!-- [193] glyph: 0x009f \237 Ydieresis -->
+Ž <!-- [194] glyph: 0x008e \216 Zcaron -->
+ž <!-- [195] glyph: 0x009e \236 zcaron -->
+ƒ <!-- [196] glyph: 0x0083 \203 florin -->
+ˆ <!-- [197] glyph: 0x0088 \210 circumflex -->
+˜ <!-- [198] glyph: 0x0098 \230 tilde -->
+– <!-- [199] glyph: 0x0096 \226 endash -->
+— <!-- [200] glyph: 0x0097 \227 emdash -->
+‘ <!-- [201] glyph: 0x0091 \221 quoteleft -->
+’ <!-- [202] glyph: 0x0092 \222 quoteright -->
+‚ <!-- [203] glyph: 0x0082 \202 quotesinglbase -->
+“ <!-- [204] glyph: 0x0093 \223 quotedblleft -->
+” <!-- [205] glyph: 0x0094 \224 quotedblright -->
+„ <!-- [206] glyph: 0x0084 \204 quotedblbase -->
+† <!-- [207] glyph: 0x0086 \206 dagger -->
+‡ <!-- [208] glyph: 0x0087 \207 daggerdbl -->
+• <!-- [209] glyph: 0x0095 \225 bullet -->
+… <!-- [210] glyph: 0x0085 \205 ellipsis -->
+‰ <!-- [211] glyph: 0x0089 \211 perthousand -->
+‹ <!-- [212] glyph: 0x008b \213 guilsinglleft -->
+› <!-- [213] glyph: 0x009b \233 guilsinglright -->
+€ <!-- [214] glyph: 0x0080 \200 Euro -->
+™ <!-- [215] glyph: 0x0099 \231 trademark -->
+<!-- 216 total, including "space" which was not specifically called out. -->
</fo:block>
<fo:block font-family="Helvetica" font-size="14pt">
@@ -158,8 +350,8 @@
<!-- zacute -->ź
<!-- zdotaccent -->ż
<!-- 99 Total -->
-<!-- Total glyphs accounted for = 215 + 99 = 314
- Total glyphs in font = 315 (one seems to be missing) -->
+<!-- Total glyphs accounted for = 216 + 99 = 315.
+ Total glyphs in font = 315. -->
</fo:block>
<fo:block font-family="Helvetica" font-size="14pt">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-06 14:58:29
|
Revision: 11890
http://sourceforge.net/p/foray/code/11890
Author: victormote
Date: 2021-02-06 14:58:27 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
Restore use of WinAnsiEncoding for fonts whose native encoding is Standard.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-02-06 14:15:59 UTC (rev 11889)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-02-06 14:58:27 UTC (rev 11890)
@@ -130,11 +130,10 @@
this.setKerning(this.metricsFile.getKerning());
/*
- * The following logic is per
- * http://www.adobe.com/support/salesdocs/10702.htm, which states:
- * "Although all Type 1 fonts can be embedded in PDF files, some
- * TrueType font manufacturers place embedding restrictions on their
- * fonts...."
+ * The following logic is per http://www.adobe.com/support/salesdocs/10702.htm, which states:
+ * "Although all Type 1 fonts can be embedded in PDF files, some TrueType font manufacturers place embedding
+ * restrictions on their fonts...."
+ * Note that there is no marking in a Type 1 font that disallows embedding.
*/
this.setAllowsEmbedding(true);
@@ -144,8 +143,13 @@
PsEncoding encoding = null;
final PsServer psServer = this.getRegisteredFont().getFontServer().getPsServer();
final PsEncoding.Predefined predefined = PsEncoding.Predefined.findByName(encodingName);
- if (predefined != null) {
- encoding = psServer.getPredefinedEncoding(predefined);
+ if (encodingName.equals("StandardEncoding")
+ || encodingName.equals("AdobeStandardEncoding")) {
+ encoding = psServer.getPredefinedEncoding(PsEncoding.Predefined.WIN_ANSI);
+ } else {
+ if (predefined != null) {
+ encoding = psServer.getPredefinedEncoding(predefined);
+ }
}
this.setInternalEncoding(encoding);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-06 14:16:04
|
Revision: 11889
http://sourceforge.net/p/foray/code/11889
Author: victormote
Date: 2021-02-06 14:15:59 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
Minor doc changes.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-02-05 22:40:33 UTC (rev 11888)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-02-06 14:15:59 UTC (rev 11889)
@@ -1021,10 +1021,6 @@
return EncodingWinAnsi.getInstance();
}
- /**
- * {@inheritDoc}
- */
- @Override
public boolean isStatic() {
return true;
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-02-05 22:40:33 UTC (rev 11888)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-02-06 14:15:59 UTC (rev 11889)
@@ -36,10 +36,16 @@
import java.io.Serializable;
/**
- * Class containing hard-coded values that represent the StandardEncoding Encoding Vector documented at PLRM3,
- * Appendix E.5.
- * It is identical to the StandardEncoding Encoding Vector documented at PDF Reference, 5th Edition, Appendix D.1.
+ * <p>Class containing hard-coded values that represent the StandardEncoding Encoding Vector documented at PostScript
+ * Language Reference, Third Edition, Appendix E.5.
+ * It is identical to the StandardEncoding Encoding Vector documented at PDF Reference, 6th Edition, Appendix D.1.</p>
*
+ * <p>From PDF Reference, Sixth Edition, Appendix D, Table D.1: "Adobe standard Latin-text encoding. This is the
+ * built-in encoding defined in Type 1 Latin-text font programs (but generally not in TrueType font programs). PDF does
+ * not have a predefined encoding named StandardEncoding. However, it is useful to describe this encoding, since a
+ * font's built-in encoding can be used as the base encoding from which differences are specified in an encoding
+ * dictionary."</p>
+ *
* <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
* following input parameters:</p>
* <ol>
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-02-05 22:40:33 UTC (rev 11888)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-02-06 14:15:59 UTC (rev 11889)
@@ -343,12 +343,10 @@
}
/**
- * Indicates whether the data in this encoding vector is static, that is,
- * tied entirely to the class itself and not built dynamically.
- * This is used primarily to determine whether the instance should actually
- * be serialized.
- * @return True iff all data in this encoding vector is static and does not
- * need to be serialized.
+ * Indicates whether the data in this encoding vector is static, that is, tied entirely to the class itself and not
+ * built dynamically.
+ * This is used primarily to determine whether the instance should actually be serialized.
+ * @return True iff all data in this encoding vector is static and does not need to be serialized.
*/
public abstract boolean isStatic();
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-02-05 22:40:33 UTC (rev 11888)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-02-06 14:15:59 UTC (rev 11889)
@@ -37,12 +37,11 @@
/**
- * Class containing hard-coded values that represent the WinAnsiEncoding
- * Encoding Vector documented at PDF Reference, 3rd Edition, Appendix D.1.
+ * <p>Class containing hard-coded values that represent the WinAnsiEncoding Encoding Vector documented at PDF Reference,
+ * Sixth Edition, Appendix D.1.</p>
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
* <li>input-file: file:./resource/encoding/latin-pdf.txt</li>
* <li>column-number: 3</li>
@@ -49,6 +48,8 @@
* <li>radix: 8</li>
* <li>output-file: [some file]</li>
* </ol>
+ *
+ * @see "PDF Reference, Sixth Edition (PDF Version 1.7), Appendix D.1."
*/
public final class EncodingWinAnsi extends EncodingVector4a
implements Serializable {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-05 22:40:36
|
Revision: 11888
http://sourceforge.net/p/foray/code/11888
Author: victormote
Date: 2021-02-05 22:40:33 +0000 (Fri, 05 Feb 2021)
Log Message:
-----------
Regenerate WinAnsi encoding, to get the the commented glyph name with each code point.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-02-05 16:44:24 UTC (rev 11887)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-02-05 22:40:33 UTC (rev 11888)
@@ -44,10 +44,10 @@
* {@link EncodingParser#main(String[])} with the following input
* parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/latin-pdf.txt</li>
+ * <li>input-file: file:./resource/encoding/latin-pdf.txt</li>
* <li>column-number: 3</li>
+ * <li>radix: 8</li>
* <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
* </ol>
*/
public final class EncodingWinAnsi extends EncodingVector4a
@@ -56,885 +56,890 @@
/** Constant needed for serialization. */
public static final long serialVersionUID = 136361072507407243L;
-/* private static final String[] sortedGlyphNames = {
- "A", // #0 glyph: 0x41 \101
- "AE", // #1 glyph: 0xc6 \306
- "Aacute", // #2 glyph: 0xc1 \301
- "Acircumflex", // #3 glyph: 0xc2 \302
- "Adieresis", // #4 glyph: 0xc4 \304
- "Agrave", // #5 glyph: 0xc0 \300
- "Aring", // #6 glyph: 0xc5 \305
- "Atilde", // #7 glyph: 0xc3 \303
- "B", // #8 glyph: 0x42 \102
- "C", // #9 glyph: 0x43 \103
- "Ccedilla", // #10 glyph: 0xc7 \307
- "D", // #11 glyph: 0x44 \104
- "E", // #12 glyph: 0x45 \105
- "Eacute", // #13 glyph: 0xc9 \311
- "Ecircumflex", // #14 glyph: 0xca \312
- "Edieresis", // #15 glyph: 0xcb \313
- "Egrave", // #16 glyph: 0xc8 \310
- "Eth", // #17 glyph: 0xd0 \320
- "Euro", // #18 glyph: 0x80 \200
- "F", // #19 glyph: 0x46 \106
- "G", // #20 glyph: 0x47 \107
- "H", // #21 glyph: 0x48 \110
- "I", // #22 glyph: 0x49 \111
- "Iacute", // #23 glyph: 0xcd \315
- "Icircumflex", // #24 glyph: 0xce \316
- "Idieresis", // #25 glyph: 0xcf \317
- "Igrave", // #26 glyph: 0xcc \314
- "J", // #27 glyph: 0x4a \112
- "K", // #28 glyph: 0x4b \113
- "L", // #29 glyph: 0x4c \114
- "M", // #30 glyph: 0x4d \115
- "N", // #31 glyph: 0x4e \116
- "Ntilde", // #32 glyph: 0xd1 \321
- "O", // #33 glyph: 0x4f \117
- "OE", // #34 glyph: 0x8c \214
- "Oacute", // #35 glyph: 0xd3 \323
- "Ocircumflex", // #36 glyph: 0xd4 \324
- "Odieresis", // #37 glyph: 0xd6 \326
- "Ograve", // #38 glyph: 0xd2 \322
- "Oslash", // #39 glyph: 0xd8 \330
- "Otilde", // #40 glyph: 0xd5 \325
- "P", // #41 glyph: 0x50 \120
- "Q", // #42 glyph: 0x51 \121
- "R", // #43 glyph: 0x52 \122
- "S", // #44 glyph: 0x53 \123
- "Scaron", // #45 glyph: 0x8a \212
- "T", // #46 glyph: 0x54 \124
- "Thorn", // #47 glyph: 0xde \336
- "U", // #48 glyph: 0x55 \125
- "Uacute", // #49 glyph: 0xda \332
- "Ucircumflex", // #50 glyph: 0xdb \333
- "Udieresis", // #51 glyph: 0xdc \334
- "Ugrave", // #52 glyph: 0xd9 \331
- "V", // #53 glyph: 0x56 \126
- "W", // #54 glyph: 0x57 \127
- "X", // #55 glyph: 0x58 \130
- "Y", // #56 glyph: 0x59 \131
- "Yacute", // #57 glyph: 0xdd \335
- "Ydieresis", // #58 glyph: 0x9f \237
- "Z", // #59 glyph: 0x5a \132
- "Zcaron", // #60 glyph: 0x8e \216
- "a", // #61 glyph: 0x61 \141
- "aacute", // #62 glyph: 0xe1 \341
- "acircumflex", // #63 glyph: 0xe2 \342
- "acute", // #64 glyph: 0xb4 \264
- "adieresis", // #65 glyph: 0xe4 \344
- "ae", // #66 glyph: 0xe6 \346
- "agrave", // #67 glyph: 0xe0 \340
- "ampersand", // #68 glyph: 0x26 \46
- "aring", // #69 glyph: 0xe5 \345
- "asciicircum", // #70 glyph: 0x5e \136
- "asciitilde", // #71 glyph: 0x7e \176
- "asterisk", // #72 glyph: 0x2a \52
- "at", // #73 glyph: 0x40 \100
- "atilde", // #74 glyph: 0xe3 \343
- "b", // #75 glyph: 0x62 \142
- "backslash", // #76 glyph: 0x5c \134
- "bar", // #77 glyph: 0x7c \174
- "braceleft", // #78 glyph: 0x7b \173
- "braceright", // #79 glyph: 0x7d \175
- "bracketleft", // #80 glyph: 0x5b \133
- "bracketright", // #81 glyph: 0x5d \135
- "brokenbar", // #82 glyph: 0xa6 \246
- "bullet", // #83 glyph: 0x95 \225
- "c", // #84 glyph: 0x63 \143
- "ccedilla", // #85 glyph: 0xe7 \347
- "cedilla", // #86 glyph: 0xb8 \270
- "cent", // #87 glyph: 0xa2 \242
- "circumflex", // #88 glyph: 0x88 \210
- "colon", // #89 glyph: 0x3a \72
- "comma", // #90 glyph: 0x2c \54
- "copyright", // #91 glyph: 0xa9 \251
- "currency", // #92 glyph: 0xa4 \244
- "d", // #93 glyph: 0x64 \144
- "dagger", // #94 glyph: 0x86 \206
- "daggerdbl", // #95 glyph: 0x87 \207
- "degree", // #96 glyph: 0xb0 \260
- "dieresis", // #97 glyph: 0xa8 \250
- "divide", // #98 glyph: 0xf7 \367
- "dollar", // #99 glyph: 0x24 \44
- "e", // #100 glyph: 0x65 \145
- "eacute", // #101 glyph: 0xe9 \351
- "ecircumflex", // #102 glyph: 0xea \352
- "edieresis", // #103 glyph: 0xeb \353
- "egrave", // #104 glyph: 0xe8 \350
- "eight", // #105 glyph: 0x38 \70
- "ellipsis", // #106 glyph: 0x85 \205
- "emdash", // #107 glyph: 0x97 \227
- "endash", // #108 glyph: 0x96 \226
- "equal", // #109 glyph: 0x3d \75
- "eth", // #110 glyph: 0xf0 \360
- "exclam", // #111 glyph: 0x21 \41
- "exclamdown", // #112 glyph: 0xa1 \241
- "f", // #113 glyph: 0x66 \146
- "five", // #114 glyph: 0x35 \65
- "florin", // #115 glyph: 0x83 \203
- "four", // #116 glyph: 0x34 \64
- "g", // #117 glyph: 0x67 \147
- "germandbls", // #118 glyph: 0xdf \337
- "grave", // #119 glyph: 0x60 \140
- "greater", // #120 glyph: 0x3e \76
- "guillemotleft", // #121 glyph: 0xab \253
- "guillemotright", // #122 glyph: 0xbb \273
- "guilsinglleft", // #123 glyph: 0x8b \213
- "guilsinglright", // #124 glyph: 0x9b \233
- "h", // #125 glyph: 0x68 \150
- "hyphen", // #126 glyph: 0x2d \55
- "i", // #127 glyph: 0x69 \151
- "iacute", // #128 glyph: 0xed \355
- "icircumflex", // #129 glyph: 0xee \356
- "idieresis", // #130 glyph: 0xef \357
- "igrave", // #131 glyph: 0xec \354
- "j", // #132 glyph: 0x6a \152
- "k", // #133 glyph: 0x6b \153
- "l", // #134 glyph: 0x6c \154
- "less", // #135 glyph: 0x3c \74
- "logicalnot", // #136 glyph: 0xac \254
- "m", // #137 glyph: 0x6d \155
- "macron", // #138 glyph: 0xaf \257
- "mu", // #139 glyph: 0xb5 \265
- "multiply", // #140 glyph: 0xd7 \327
- "n", // #141 glyph: 0x6e \156
- "nine", // #142 glyph: 0x39 \71
- "ntilde", // #143 glyph: 0xf1 \361
- "numbersign", // #144 glyph: 0x23 \43
- "o", // #145 glyph: 0x6f \157
- "oacute", // #146 glyph: 0xf3 \363
- "ocircumflex", // #147 glyph: 0xf4 \364
- "odieresis", // #148 glyph: 0xf6 \366
- "oe", // #149 glyph: 0x9c \234
- "ograve", // #150 glyph: 0xf2 \362
- "one", // #151 glyph: 0x31 \61
- "onehalf", // #152 glyph: 0xbd \275
- "onequarter", // #153 glyph: 0xbc \274
- "onesuperior", // #154 glyph: 0xb9 \271
- "ordfeminine", // #155 glyph: 0xaa \252
- "ordmasculine", // #156 glyph: 0xba \272
- "oslash", // #157 glyph: 0xf8 \370
- "otilde", // #158 glyph: 0xf5 \365
- "p", // #159 glyph: 0x70 \160
- "paragraph", // #160 glyph: 0xb6 \266
- "parenleft", // #161 glyph: 0x28 \50
- "parenright", // #162 glyph: 0x29 \51
- "percent", // #163 glyph: 0x25 \45
- "period", // #164 glyph: 0x2e \56
- "periodcentered", // #165 glyph: 0xb7 \267
- "perthousand", // #166 glyph: 0x89 \211
- "plus", // #167 glyph: 0x2b \53
- "plusminus", // #168 glyph: 0xb1 \261
- "q", // #169 glyph: 0x71 \161
- "question", // #170 glyph: 0x3f \77
- "questiondown", // #171 glyph: 0xbf \277
- "quotedbl", // #172 glyph: 0x22 \42
- "quotedblbase", // #173 glyph: 0x84 \204
- "quotedblleft", // #174 glyph: 0x93 \223
- "quotedblright", // #175 glyph: 0x94 \224
- "quoteleft", // #176 glyph: 0x91 \221
- "quoteright", // #177 glyph: 0x92 \222
- "quotesinglbase", // #178 glyph: 0x82 \202
- "quotesingle", // #179 glyph: 0x27 \47
- "r", // #180 glyph: 0x72 \162
- "registered", // #181 glyph: 0xae \256
- "s", // #182 glyph: 0x73 \163
- "scaron", // #183 glyph: 0x9a \232
- "section", // #184 glyph: 0xa7 \247
- "semicolon", // #185 glyph: 0x3b \73
- "seven", // #186 glyph: 0x37 \67
- "six", // #187 glyph: 0x36 \66
- "slash", // #188 glyph: 0x2f \57
- "space", // #189 glyph: 0x20 \40
- "sterling", // #190 glyph: 0xa3 \243
- "t", // #191 glyph: 0x74 \164
- "thorn", // #192 glyph: 0xfe \376
- "three", // #193 glyph: 0x33 \63
- "threequarters", // #194 glyph: 0xbe \276
- "threesuperior", // #195 glyph: 0xb3 \263
- "tilde", // #196 glyph: 0x98 \230
- "trademark", // #197 glyph: 0x99 \231
- "two", // #198 glyph: 0x32 \62
- "twosuperior", // #199 glyph: 0xb2 \262
- "u", // #200 glyph: 0x75 \165
- "uacute", // #201 glyph: 0xfa \372
- "ucircumflex", // #202 glyph: 0xfb \373
- "udieresis", // #203 glyph: 0xfc \374
- "ugrave", // #204 glyph: 0xf9 \371
- "underscore", // #205 glyph: 0x5f \137
- "v", // #206 glyph: 0x76 \166
- "w", // #207 glyph: 0x77 \167
- "x", // #208 glyph: 0x78 \170
- "y", // #209 glyph: 0x79 \171
- "yacute", // #210 glyph: 0xfd \375
- "ydieresis", // #211 glyph: 0xff \377
- "yen", // #212 glyph: 0xa5 \245
- "z", // #213 glyph: 0x7a \172
- "zcaron", // #214 glyph: 0x9e \236
- "zero" // #215 glyph: 0x30 \60
+ /*
+ private static final String[] GLYPH_NAMES = {
+ "A", // [0] glyph-index: 0x0041 \101
+ "AE", // [1] glyph-index: 0x00c6 \306
+ "Aacute", // [2] glyph-index: 0x00c1 \301
+ "Acircumflex", // [3] glyph-index: 0x00c2 \302
+ "Adieresis", // [4] glyph-index: 0x00c4 \304
+ "Agrave", // [5] glyph-index: 0x00c0 \300
+ "Aring", // [6] glyph-index: 0x00c5 \305
+ "Atilde", // [7] glyph-index: 0x00c3 \303
+ "B", // [8] glyph-index: 0x0042 \102
+ "C", // [9] glyph-index: 0x0043 \103
+ "Ccedilla", // [10] glyph-index: 0x00c7 \307
+ "D", // [11] glyph-index: 0x0044 \104
+ "E", // [12] glyph-index: 0x0045 \105
+ "Eacute", // [13] glyph-index: 0x00c9 \311
+ "Ecircumflex", // [14] glyph-index: 0x00ca \312
+ "Edieresis", // [15] glyph-index: 0x00cb \313
+ "Egrave", // [16] glyph-index: 0x00c8 \310
+ "Eth", // [17] glyph-index: 0x00d0 \320
+ "Euro", // [18] glyph-index: 0x0080 \200
+ "F", // [19] glyph-index: 0x0046 \106
+ "G", // [20] glyph-index: 0x0047 \107
+ "H", // [21] glyph-index: 0x0048 \110
+ "I", // [22] glyph-index: 0x0049 \111
+ "Iacute", // [23] glyph-index: 0x00cd \315
+ "Icircumflex", // [24] glyph-index: 0x00ce \316
+ "Idieresis", // [25] glyph-index: 0x00cf \317
+ "Igrave", // [26] glyph-index: 0x00cc \314
+ "J", // [27] glyph-index: 0x004a \112
+ "K", // [28] glyph-index: 0x004b \113
+ "L", // [29] glyph-index: 0x004c \114
+ "M", // [30] glyph-index: 0x004d \115
+ "N", // [31] glyph-index: 0x004e \116
+ "Ntilde", // [32] glyph-index: 0x00d1 \321
+ "O", // [33] glyph-index: 0x004f \117
+ "OE", // [34] glyph-index: 0x008c \214
+ "Oacute", // [35] glyph-index: 0x00d3 \323
+ "Ocircumflex", // [36] glyph-index: 0x00d4 \324
+ "Odieresis", // [37] glyph-index: 0x00d6 \326
+ "Ograve", // [38] glyph-index: 0x00d2 \322
+ "Oslash", // [39] glyph-index: 0x00d8 \330
+ "Otilde", // [40] glyph-index: 0x00d5 \325
+ "P", // [41] glyph-index: 0x0050 \120
+ "Q", // [42] glyph-index: 0x0051 \121
+ "R", // [43] glyph-index: 0x0052 \122
+ "S", // [44] glyph-index: 0x0053 \123
+ "Scaron", // [45] glyph-index: 0x008a \212
+ "T", // [46] glyph-index: 0x0054 \124
+ "Thorn", // [47] glyph-index: 0x00de \336
+ "U", // [48] glyph-index: 0x0055 \125
+ "Uacute", // [49] glyph-index: 0x00da \332
+ "Ucircumflex", // [50] glyph-index: 0x00db \333
+ "Udieresis", // [51] glyph-index: 0x00dc \334
+ "Ugrave", // [52] glyph-index: 0x00d9 \331
+ "V", // [53] glyph-index: 0x0056 \126
+ "W", // [54] glyph-index: 0x0057 \127
+ "X", // [55] glyph-index: 0x0058 \130
+ "Y", // [56] glyph-index: 0x0059 \131
+ "Yacute", // [57] glyph-index: 0x00dd \335
+ "Ydieresis", // [58] glyph-index: 0x009f \237
+ "Z", // [59] glyph-index: 0x005a \132
+ "Zcaron", // [60] glyph-index: 0x008e \216
+ "a", // [61] glyph-index: 0x0061 \141
+ "aacute", // [62] glyph-index: 0x00e1 \341
+ "acircumflex", // [63] glyph-index: 0x00e2 \342
+ "acute", // [64] glyph-index: 0x00b4 \264
+ "adieresis", // [65] glyph-index: 0x00e4 \344
+ "ae", // [66] glyph-index: 0x00e6 \346
+ "agrave", // [67] glyph-index: 0x00e0 \340
+ "ampersand", // [68] glyph-index: 0x0026 \046
+ "aring", // [69] glyph-index: 0x00e5 \345
+ "asciicircum", // [70] glyph-index: 0x005e \136
+ "asciitilde", // [71] glyph-index: 0x007e \176
+ "asterisk", // [72] glyph-index: 0x002a \052
+ "at", // [73] glyph-index: 0x0040 \100
+ "atilde", // [74] glyph-index: 0x00e3 \343
+ "b", // [75] glyph-index: 0x0062 \142
+ "backslash", // [76] glyph-index: 0x005c \134
+ "bar", // [77] glyph-index: 0x007c \174
+ "braceleft", // [78] glyph-index: 0x007b \173
+ "braceright", // [79] glyph-index: 0x007d \175
+ "bracketleft", // [80] glyph-index: 0x005b \133
+ "bracketright", // [81] glyph-index: 0x005d \135
+ "brokenbar", // [82] glyph-index: 0x00a6 \246
+ "bullet", // [83] glyph-index: 0x0095 \225
+ "c", // [84] glyph-index: 0x0063 \143
+ "ccedilla", // [85] glyph-index: 0x00e7 \347
+ "cedilla", // [86] glyph-index: 0x00b8 \270
+ "cent", // [87] glyph-index: 0x00a2 \242
+ "circumflex", // [88] glyph-index: 0x0088 \210
+ "colon", // [89] glyph-index: 0x003a \072
+ "comma", // [90] glyph-index: 0x002c \054
+ "copyright", // [91] glyph-index: 0x00a9 \251
+ "currency", // [92] glyph-index: 0x00a4 \244
+ "d", // [93] glyph-index: 0x0064 \144
+ "dagger", // [94] glyph-index: 0x0086 \206
+ "daggerdbl", // [95] glyph-index: 0x0087 \207
+ "degree", // [96] glyph-index: 0x00b0 \260
+ "dieresis", // [97] glyph-index: 0x00a8 \250
+ "divide", // [98] glyph-index: 0x00f7 \367
+ "dollar", // [99] glyph-index: 0x0024 \044
+ "e", // [100] glyph-index: 0x0065 \145
+ "eacute", // [101] glyph-index: 0x00e9 \351
+ "ecircumflex", // [102] glyph-index: 0x00ea \352
+ "edieresis", // [103] glyph-index: 0x00eb \353
+ "egrave", // [104] glyph-index: 0x00e8 \350
+ "eight", // [105] glyph-index: 0x0038 \070
+ "ellipsis", // [106] glyph-index: 0x0085 \205
+ "emdash", // [107] glyph-index: 0x0097 \227
+ "endash", // [108] glyph-index: 0x0096 \226
+ "equal", // [109] glyph-index: 0x003d \075
+ "eth", // [110] glyph-index: 0x00f0 \360
+ "exclam", // [111] glyph-index: 0x0021 \041
+ "exclamdown", // [112] glyph-index: 0x00a1 \241
+ "f", // [113] glyph-index: 0x0066 \146
+ "five", // [114] glyph-index: 0x0035 \065
+ "florin", // [115] glyph-index: 0x0083 \203
+ "four", // [116] glyph-index: 0x0034 \064
+ "g", // [117] glyph-index: 0x0067 \147
+ "germandbls", // [118] glyph-index: 0x00df \337
+ "grave", // [119] glyph-index: 0x0060 \140
+ "greater", // [120] glyph-index: 0x003e \076
+ "guillemotleft", // [121] glyph-index: 0x00ab \253
+ "guillemotright", // [122] glyph-index: 0x00bb \273
+ "guilsinglleft", // [123] glyph-index: 0x008b \213
+ "guilsinglright", // [124] glyph-index: 0x009b \233
+ "h", // [125] glyph-index: 0x0068 \150
+ "hyphen", // [126] glyph-index: 0x002d \055
+ "i", // [127] glyph-index: 0x0069 \151
+ "iacute", // [128] glyph-index: 0x00ed \355
+ "icircumflex", // [129] glyph-index: 0x00ee \356
+ "idieresis", // [130] glyph-index: 0x00ef \357
+ "igrave", // [131] glyph-index: 0x00ec \354
+ "j", // [132] glyph-index: 0x006a \152
+ "k", // [133] glyph-index: 0x006b \153
+ "l", // [134] glyph-index: 0x006c \154
+ "less", // [135] glyph-index: 0x003c \074
+ "logicalnot", // [136] glyph-index: 0x00ac \254
+ "m", // [137] glyph-index: 0x006d \155
+ "macron", // [138] glyph-index: 0x00af \257
+ "mu", // [139] glyph-index: 0x00b5 \265
+ "multiply", // [140] glyph-index: 0x00d7 \327
+ "n", // [141] glyph-index: 0x006e \156
+ "nine", // [142] glyph-index: 0x0039 \071
+ "ntilde", // [143] glyph-index: 0x00f1 \361
+ "numbersign", // [144] glyph-index: 0x0023 \043
+ "o", // [145] glyph-index: 0x006f \157
+ "oacute", // [146] glyph-index: 0x00f3 \363
+ "ocircumflex", // [147] glyph-index: 0x00f4 \364
+ "odieresis", // [148] glyph-index: 0x00f6 \366
+ "oe", // [149] glyph-index: 0x009c \234
+ "ograve", // [150] glyph-index: 0x00f2 \362
+ "one", // [151] glyph-index: 0x0031 \061
+ "onehalf", // [152] glyph-index: 0x00bd \275
+ "onequarter", // [153] glyph-index: 0x00bc \274
+ "onesuperior", // [154] glyph-index: 0x00b9 \271
+ "ordfeminine", // [155] glyph-index: 0x00aa \252
+ "ordmasculine", // [156] glyph-index: 0x00ba \272
+ "oslash", // [157] glyph-index: 0x00f8 \370
+ "otilde", // [158] glyph-index: 0x00f5 \365
+ "p", // [159] glyph-index: 0x0070 \160
+ "paragraph", // [160] glyph-index: 0x00b6 \266
+ "parenleft", // [161] glyph-index: 0x0028 \050
+ "parenright", // [162] glyph-index: 0x0029 \051
+ "percent", // [163] glyph-index: 0x0025 \045
+ "period", // [164] glyph-index: 0x002e \056
+ "periodcentered", // [165] glyph-index: 0x00b7 \267
+ "perthousand", // [166] glyph-index: 0x0089 \211
+ "plus", // [167] glyph-index: 0x002b \053
+ "plusminus", // [168] glyph-index: 0x00b1 \261
+ "q", // [169] glyph-index: 0x0071 \161
+ "question", // [170] glyph-index: 0x003f \077
+ "questiondown", // [171] glyph-index: 0x00bf \277
+ "quotedbl", // [172] glyph-index: 0x0022 \042
+ "quotedblbase", // [173] glyph-index: 0x0084 \204
+ "quotedblleft", // [174] glyph-index: 0x0093 \223
+ "quotedblright", // [175] glyph-index: 0x0094 \224
+ "quoteleft", // [176] glyph-index: 0x0091 \221
+ "quoteright", // [177] glyph-index: 0x0092 \222
+ "quotesinglbase", // [178] glyph-index: 0x0082 \202
+ "quotesingle", // [179] glyph-index: 0x0027 \047
+ "r", // [180] glyph-index: 0x0072 \162
+ "registered", // [181] glyph-index: 0x00ae \256
+ "s", // [182] glyph-index: 0x0073 \163
+ "scaron", // [183] glyph-index: 0x009a \232
+ "section", // [184] glyph-index: 0x00a7 \247
+ "semicolon", // [185] glyph-index: 0x003b \073
+ "seven", // [186] glyph-index: 0x0037 \067
+ "six", // [187] glyph-index: 0x0036 \066
+ "slash", // [188] glyph-index: 0x002f \057
+ "space", // [189] glyph-index: 0x0020 \040
+ "sterling", // [190] glyph-index: 0x00a3 \243
+ "t", // [191] glyph-index: 0x0074 \164
+ "thorn", // [192] glyph-index: 0x00fe \376
+ "three", // [193] glyph-index: 0x0033 \063
+ "threequarters", // [194] glyph-index: 0x00be \276
+ "threesuperior", // [195] glyph-index: 0x00b3 \263
+ "tilde", // [196] glyph-index: 0x0098 \230
+ "trademark", // [197] glyph-index: 0x0099 \231
+ "two", // [198] glyph-index: 0x0032 \062
+ "twosuperior", // [199] glyph-index: 0x00b2 \262
+ "u", // [200] glyph-index: 0x0075 \165
+ "uacute", // [201] glyph-index: 0x00fa \372
+ "ucircumflex", // [202] glyph-index: 0x00fb \373
+ "udieresis", // [203] glyph-index: 0x00fc \374
+ "ugrave", // [204] glyph-index: 0x00f9 \371
+ "underscore", // [205] glyph-index: 0x005f \137
+ "v", // [206] glyph-index: 0x0076 \166
+ "w", // [207] glyph-index: 0x0077 \167
+ "x", // [208] glyph-index: 0x0078 \170
+ "y", // [209] glyph-index: 0x0079 \171
+ "yacute", // [210] glyph-index: 0x00fd \375
+ "ydieresis", // [211] glyph-index: 0x00ff \377
+ "yen", // [212] glyph-index: 0x00a5 \245
+ "z", // [213] glyph-index: 0x007a \172
+ "zcaron", // [214] glyph-index: 0x009e \236
+ "zero" // [215] glyph-index: 0x0030 \060
};
- private static final short[] glyphIndexes = {
- 0x41, // #0
- 0xc6, // #1
- 0xc1, // #2
- 0xc2, // #3
- 0xc4, // #4
- 0xc0, // #5
- 0xc5, // #6
- 0xc3, // #7
- 0x42, // #8
- 0x43, // #9
- 0xc7, // #10
- 0x44, // #11
- 0x45, // #12
- 0xc9, // #13
- 0xca, // #14
- 0xcb, // #15
- 0xc8, // #16
- 0xd0, // #17
- 0x80, // #18
- 0x46, // #19
- 0x47, // #20
- 0x48, // #21
- 0x49, // #22
- 0xcd, // #23
- 0xce, // #24
- 0xcf, // #25
- 0xcc, // #26
- 0x4a, // #27
- 0x4b, // #28
- 0x4c, // #29
- 0x4d, // #30
- 0x4e, // #31
- 0xd1, // #32
- 0x4f, // #33
- 0x8c, // #34
- 0xd3, // #35
- 0xd4, // #36
- 0xd6, // #37
- 0xd2, // #38
- 0xd8, // #39
- 0xd5, // #40
- 0x50, // #41
- 0x51, // #42
- 0x52, // #43
- 0x53, // #44
- 0x8a, // #45
- 0x54, // #46
- 0xde, // #47
- 0x55, // #48
- 0xda, // #49
- 0xdb, // #50
- 0xdc, // #51
- 0xd9, // #52
- 0x56, // #53
- 0x57, // #54
- 0x58, // #55
- 0x59, // #56
- 0xdd, // #57
- 0x9f, // #58
- 0x5a, // #59
- 0x8e, // #60
- 0x61, // #61
- 0xe1, // #62
- 0xe2, // #63
- 0xb4, // #64
- 0xe4, // #65
- 0xe6, // #66
- 0xe0, // #67
- 0x26, // #68
- 0xe5, // #69
- 0x5e, // #70
- 0x7e, // #71
- 0x2a, // #72
- 0x40, // #73
- 0xe3, // #74
- 0x62, // #75
- 0x5c, // #76
- 0x7c, // #77
- 0x7b, // #78
- 0x7d, // #79
- 0x5b, // #80
- 0x5d, // #81
- 0xa6, // #82
- 0x95, // #83
- 0x63, // #84
- 0xe7, // #85
- 0xb8, // #86
- 0xa2, // #87
- 0x88, // #88
- 0x3a, // #89
- 0x2c, // #90
- 0xa9, // #91
- 0xa4, // #92
- 0x64, // #93
- 0x86, // #94
- 0x87, // #95
- 0xb0, // #96
- 0xa8, // #97
- 0xf7, // #98
- 0x24, // #99
- 0x65, // #100
- 0xe9, // #101
- 0xea, // #102
- 0xeb, // #103
- 0xe8, // #104
- 0x38, // #105
- 0x85, // #106
- 0x97, // #107
- 0x96, // #108
- 0x3d, // #109
- 0xf0, // #110
- 0x21, // #111
- 0xa1, // #112
- 0x66, // #113
- 0x35, // #114
- 0x83, // #115
- 0x34, // #116
- 0x67, // #117
- 0xdf, // #118
- 0x60, // #119
- 0x3e, // #120
- 0xab, // #121
- 0xbb, // #122
- 0x8b, // #123
- 0x9b, // #124
- 0x68, // #125
- 0x2d, // #126
- 0x69, // #127
- 0xed, // #128
- 0xee, // #129
- 0xef, // #130
- 0xec, // #131
- 0x6a, // #132
- 0x6b, // #133
- 0x6c, // #134
- 0x3c, // #135
- 0xac, // #136
- 0x6d, // #137
- 0xaf, // #138
- 0xb5, // #139
- 0xd7, // #140
- 0x6e, // #141
- 0x39, // #142
- 0xf1, // #143
- 0x23, // #144
- 0x6f, // #145
- 0xf3, // #146
- 0xf4, // #147
- 0xf6, // #148
- 0x9c, // #149
- 0xf2, // #150
- 0x31, // #151
- 0xbd, // #152
- 0xbc, // #153
- 0xb9, // #154
- 0xaa, // #155
- 0xba, // #156
- 0xf8, // #157
- 0xf5, // #158
- 0x70, // #159
- 0xb6, // #160
- 0x28, // #161
- 0x29, // #162
- 0x25, // #163
- 0x2e, // #164
- 0xb7, // #165
- 0x89, // #166
- 0x2b, // #167
- 0xb1, // #168
- 0x71, // #169
- 0x3f, // #170
- 0xbf, // #171
- 0x22, // #172
- 0x84, // #173
- 0x93, // #174
- 0x94, // #175
- 0x91, // #176
- 0x92, // #177
- 0x82, // #178
- 0x27, // #179
- 0x72, // #180
- 0xae, // #181
- 0x73, // #182
- 0x9a, // #183
- 0xa7, // #184
- 0x3b, // #185
- 0x37, // #186
- 0x36, // #187
- 0x2f, // #188
- 0x20, // #189
- 0xa3, // #190
- 0x74, // #191
- 0xfe, // #192
- 0x33, // #193
- 0xbe, // #194
- 0xb3, // #195
- 0x98, // #196
- 0x99, // #197
- 0x32, // #198
- 0xb2, // #199
- 0x75, // #200
- 0xfa, // #201
- 0xfb, // #202
- 0xfc, // #203
- 0xf9, // #204
- 0x5f, // #205
- 0x76, // #206
- 0x77, // #207
- 0x78, // #208
- 0x79, // #209
- 0xfd, // #210
- 0xff, // #211
- 0xa5, // #212
- 0x7a, // #213
- 0x9e, // #214
- 0x30 // #215
+ private static final short[] GLYPH_INDEXES = {
+ 0x0041, // [0] \101 A
+ 0x00c6, // [1] \306 AE
+ 0x00c1, // [2] \301 Aacute
+ 0x00c2, // [3] \302 Acircumflex
+ 0x00c4, // [4] \304 Adieresis
+ 0x00c0, // [5] \300 Agrave
+ 0x00c5, // [6] \305 Aring
+ 0x00c3, // [7] \303 Atilde
+ 0x0042, // [8] \102 B
+ 0x0043, // [9] \103 C
+ 0x00c7, // [10] \307 Ccedilla
+ 0x0044, // [11] \104 D
+ 0x0045, // [12] \105 E
+ 0x00c9, // [13] \311 Eacute
+ 0x00ca, // [14] \312 Ecircumflex
+ 0x00cb, // [15] \313 Edieresis
+ 0x00c8, // [16] \310 Egrave
+ 0x00d0, // [17] \320 Eth
+ 0x0080, // [18] \200 Euro
+ 0x0046, // [19] \106 F
+ 0x0047, // [20] \107 G
+ 0x0048, // [21] \110 H
+ 0x0049, // [22] \111 I
+ 0x00cd, // [23] \315 Iacute
+ 0x00ce, // [24] \316 Icircumflex
+ 0x00cf, // [25] \317 Idieresis
+ 0x00cc, // [26] \314 Igrave
+ 0x004a, // [27] \112 J
+ 0x004b, // [28] \113 K
+ 0x004c, // [29] \114 L
+ 0x004d, // [30] \115 M
+ 0x004e, // [31] \116 N
+ 0x00d1, // [32] \321 Ntilde
+ 0x004f, // [33] \117 O
+ 0x008c, // [34] \214 OE
+ 0x00d3, // [35] \323 Oacute
+ 0x00d4, // [36] \324 Ocircumflex
+ 0x00d6, // [37] \326 Odieresis
+ 0x00d2, // [38] \322 Ograve
+ 0x00d8, // [39] \330 Oslash
+ 0x00d5, // [40] \325 Otilde
+ 0x0050, // [41] \120 P
+ 0x0051, // [42] \121 Q
+ 0x0052, // [43] \122 R
+ 0x0053, // [44] \123 S
+ 0x008a, // [45] \212 Scaron
+ 0x0054, // [46] \124 T
+ 0x00de, // [47] \336 Thorn
+ 0x0055, // [48] \125 U
+ 0x00da, // [49] \332 Uacute
+ 0x00db, // [50] \333 Ucircumflex
+ 0x00dc, // [51] \334 Udieresis
+ 0x00d9, // [52] \331 Ugrave
+ 0x0056, // [53] \126 V
+ 0x0057, // [54] \127 W
+ 0x0058, // [55] \130 X
+ 0x0059, // [56] \131 Y
+ 0x00dd, // [57] \335 Yacute
+ 0x009f, // [58] \237 Ydieresis
+ 0x005a, // [59] \132 Z
+ 0x008e, // [60] \216 Zcaron
+ 0x0061, // [61] \141 a
+ 0x00e1, // [62] \341 aacute
+ 0x00e2, // [63] \342 acircumflex
+ 0x00b4, // [64] \264 acute
+ 0x00e4, // [65] \344 adieresis
+ 0x00e6, // [66] \346 ae
+ 0x00e0, // [67] \340 agrave
+ 0x0026, // [68] \046 ampersand
+ 0x00e5, // [69] \345 aring
+ 0x005e, // [70] \136 asciicircum
+ 0x007e, // [71] \176 asciitilde
+ 0x002a, // [72] \052 asterisk
+ 0x0040, // [73] \100 at
+ 0x00e3, // [74] \343 atilde
+ 0x0062, // [75] \142 b
+ 0x005c, // [76] \134 backslash
+ 0x007c, // [77] \174 bar
+ 0x007b, // [78] \173 braceleft
+ 0x007d, // [79] \175 braceright
+ 0x005b, // [80] \133 bracketleft
+ 0x005d, // [81] \135 bracketright
+ 0x00a6, // [82] \246 brokenbar
+ 0x0095, // [83] \225 bullet
+ 0x0063, // [84] \143 c
+ 0x00e7, // [85] \347 ccedilla
+ 0x00b8, // [86] \270 cedilla
+ 0x00a2, // [87] \242 cent
+ 0x0088, // [88] \210 circumflex
+ 0x003a, // [89] \072 colon
+ 0x002c, // [90] \054 comma
+ 0x00a9, // [91] \251 copyright
+ 0x00a4, // [92] \244 currency
+ 0x0064, // [93] \144 d
+ 0x0086, // [94] \206 dagger
+ 0x0087, // [95] \207 daggerdbl
+ 0x00b0, // [96] \260 degree
+ 0x00a8, // [97] \250 dieresis
+ 0x00f7, // [98] \367 divide
+ 0x0024, // [99] \044 dollar
+ 0x0065, // [100] \145 e
+ 0x00e9, // [101] \351 eacute
+ 0x00ea, // [102] \352 ecircumflex
+ 0x00eb, // [103] \353 edieresis
+ 0x00e8, // [104] \350 egrave
+ 0x0038, // [105] \070 eight
+ 0x0085, // [106] \205 ellipsis
+ 0x0097, // [107] \227 emdash
+ 0x0096, // [108] \226 endash
+ 0x003d, // [109] \075 equal
+ 0x00f0, // [110] \360 eth
+ 0x0021, // [111] \041 exclam
+ 0x00a1, // [112] \241 exclamdown
+ 0x0066, // [113] \146 f
+ 0x0035, // [114] \065 five
+ 0x0083, // [115] \203 florin
+ 0x0034, // [116] \064 four
+ 0x0067, // [117] \147 g
+ 0x00df, // [118] \337 germandbls
+ 0x0060, // [119] \140 grave
+ 0x003e, // [120] \076 greater
+ 0x00ab, // [121] \253 guillemotleft
+ 0x00bb, // [122] \273 guillemotright
+ 0x008b, // [123] \213 guilsinglleft
+ 0x009b, // [124] \233 guilsinglright
+ 0x0068, // [125] \150 h
+ 0x002d, // [126] \055 hyphen
+ 0x0069, // [127] \151 i
+ 0x00ed, // [128] \355 iacute
+ 0x00ee, // [129] \356 icircumflex
+ 0x00ef, // [130] \357 idieresis
+ 0x00ec, // [131] \354 igrave
+ 0x006a, // [132] \152 j
+ 0x006b, // [133] \153 k
+ 0x006c, // [134] \154 l
+ 0x003c, // [135] \074 less
+ 0x00ac, // [136] \254 logicalnot
+ 0x006d, // [137] \155 m
+ 0x00af, // [138] \257 macron
+ 0x00b5, // [139] \265 mu
+ 0x00d7, // [140] \327 multiply
+ 0x006e, // [141] \156 n
+ 0x0039, // [142] \071 nine
+ 0x00f1, // [143] \361 ntilde
+ 0x0023, // [144] \043 numbersign
+ 0x006f, // [145] \157 o
+ 0x00f3, // [146] \363 oacute
+ 0x00f4, // [147] \364 ocircumflex
+ 0x00f6, // [148] \366 odieresis
+ 0x009c, // [149] \234 oe
+ 0x00f2, // [150] \362 ograve
+ 0x0031, // [151] \061 one
+ 0x00bd, // [152] \275 onehalf
+ 0x00bc, // [153] \274 onequarter
+ 0x00b9, // [154] \271 onesuperior
+ 0x00aa, // [155] \252 ordfeminine
+ 0x00ba, // [156] \272 ordmasculine
+ 0x00f8, // [157] \370 oslash
+ 0x00f5, // [158] \365 otilde
+ 0x0070, // [159] \160 p
+ 0x00b6, // [160] \266 paragraph
+ 0x0028, // [161] \050 parenleft
+ 0x0029, // [162] \051 parenright
+ 0x0025, // [163] \045 percent
+ 0x002e, // [164] \056 period
+ 0x00b7, // [165] \267 periodcentered
+ 0x0089, // [166] \211 perthousand
+ 0x002b, // [167] \053 plus
+ 0x00b1, // [168] \261 plusminus
+ 0x0071, // [169] \161 q
+ 0x003f, // [170] \077 question
+ 0x00bf, // [171] \277 questiondown
+ 0x0022, // [172] \042 quotedbl
+ 0x0084, // [173] \204 quotedblbase
+ 0x0093, // [174] \223 quotedblleft
+ 0x0094, // [175] \224 quotedblright
+ 0x0091, // [176] \221 quoteleft
+ 0x0092, // [177] \222 quoteright
+ 0x0082, // [178] \202 quotesinglbase
+ 0x0027, // [179] \047 quotesingle
+ 0x0072, // [180] \162 r
+ 0x00ae, // [181] \256 registered
+ 0x0073, // [182] \163 s
+ 0x009a, // [183] \232 scaron
+ 0x00a7, // [184] \247 section
+ 0x003b, // [185] \073 semicolon
+ 0x0037, // [186] \067 seven
+ 0x0036, // [187] \066 six
+ 0x002f, // [188] \057 slash
+ 0x0020, // [189] \040 space
+ 0x00a3, // [190] \243 sterling
+ 0x0074, // [191] \164 t
+ 0x00fe, // [192] \376 thorn
+ 0x0033, // [193] \063 three
+ 0x00be, // [194] \276 threequarters
+ 0x00b3, // [195] \263 threesuperior
+ 0x0098, // [196] \230 tilde
+ 0x0099, // [197] \231 trademark
+ 0x0032, // [198] \062 two
+ 0x00b2, // [199] \262 twosuperior
+ 0x0075, // [200] \165 u
+ 0x00fa, // [201] \372 uacute
+ 0x00fb, // [202] \373 ucircumflex
+ 0x00fc, // [203] \374 udieresis
+ 0x00f9, // [204] \371 ugrave
+ 0x005f, // [205] \137 underscore
+ 0x0076, // [206] \166 v
+ 0x0077, // [207] \167 w
+ 0x0078, // [208] \170 x
+ 0x0079, // [209] \171 y
+ 0x00fd, // [210] \375 yacute
+ 0x00ff, // [211] \377 ydieresis
+ 0x00a5, // [212] \245 yen
+ 0x007a, // [213] \172 z
+ 0x009e, // [214] \236 zcaron
+ 0x0030 // [215] \060 zero
};
*/
- /** The Unicode codepoints encoded in this encoding. */
+ /**
+ * The Unicode codepoints encoded in this encoding, sorted.
+ */
private static final char[] CODE_POINTS = {
- 0x20, // #0 glyph: 0x20 \40
- 0x21, // #1 glyph: 0x21 \41
- 0x22, // #2 glyph: 0x22 \42
- 0x23, // #3 glyph: 0x23 \43
- 0x24, // #4 glyph: 0x24 \44
- 0x25, // #5 glyph: 0x25 \45
- 0x26, // #6 glyph: 0x26 \46
- 0x27, // #7 glyph: 0x27 \47
- 0x28, // #8 glyph: 0x28 \50
- 0x29, // #9 glyph: 0x29 \51
- 0x2a, // #10 glyph: 0x2a \52
- 0x2b, // #11 glyph: 0x2b \53
- 0x2c, // #12 glyph: 0x2c \54
- 0x2d, // #13 glyph: 0x2d \55
- 0x2e, // #14 glyph: 0x2e \56
- 0x2f, // #15 glyph: 0x2f \57
- 0x30, // #16 glyph: 0x30 \60
- 0x31, // #17 glyph: 0x31 \61
- 0x32, // #18 glyph: 0x32 \62
- 0x33, // #19 glyph: 0x33 \63
- 0x34, // #20 glyph: 0x34 \64
- 0x35, // #21 glyph: 0x35 \65
- 0x36, // #22 glyph: 0x36 \66
- 0x37, // #23 glyph: 0x37 \67
- 0x38, // #24 glyph: 0x38 \70
- 0x39, // #25 glyph: 0x39 \71
- 0x3a, // #26 glyph: 0x3a \72
- 0x3b, // #27 glyph: 0x3b \73
- 0x3c, // #28 glyph: 0x3c \74
- 0x3d, // #29 glyph: 0x3d \75
- 0x3e, // #30 glyph: 0x3e \76
- 0x3f, // #31 glyph: 0x3f \77
- 0x40, // #32 glyph: 0x40 \100
- 0x41, // #33 glyph: 0x41 \101
- 0x42, // #34 glyph: 0x42 \102
- 0x43, // #35 glyph: 0x43 \103
- 0x44, // #36 glyph: 0x44 \104
- 0x45, // #37 glyph: 0x45 \105
- 0x46, // #38 glyph: 0x46 \106
- 0x47, // #39 glyph: 0x47 \107
- 0x48, // #40 glyph: 0x48 \110
- 0x49, // #41 glyph: 0x49 \111
- 0x4a, // #42 glyph: 0x4a \112
- 0x4b, // #43 glyph: 0x4b \113
- 0x4c, // #44 glyph: 0x4c \114
- 0x4d, // #45 glyph: 0x4d \115
- 0x4e, // #46 glyph: 0x4e \116
- 0x4f, // #47 glyph: 0x4f \117
- 0x50, // #48 glyph: 0x50 \120
- 0x51, // #49 glyph: 0x51 \121
- 0x52, // #50 glyph: 0x52 \122
- 0x53, // #51 glyph: 0x53 \123
- 0x54, // #52 glyph: 0x54 \124
- 0x55, // #53 glyph: 0x55 \125
- 0x56, // #54 glyph: 0x56 \126
- 0x57, // #55 glyph: 0x57 \127
- 0x58, // #56 glyph: 0x58 \130
- 0x59, // #57 glyph: 0x59 \131
- 0x5a, // #58 glyph: 0x5a \132
- 0x5b, // #59 glyph: 0x5b \133
- 0x5c, // #60 glyph: 0x5c \134
- 0x5d, // #61 glyph: 0x5d \135
- 0x5e, // #62 glyph: 0x5e \136
- 0x5f, // #63 glyph: 0x5f \137
- 0x60, // #64 glyph: 0x60 \140
- 0x61, // #65 glyph: 0x61 \141
- 0x62, // #66 glyph: 0x62 \142
- 0x63, // #67 glyph: 0x63 \143
- 0x64, // #68 glyph: 0x64 \144
- 0x65, // #69 glyph: 0x65 \145
- 0x66, // #70 glyph: 0x66 \146
- 0x67, // #71 glyph: 0x67 \147
- 0x68, // #72 glyph: 0x68 \150
- 0x69, // #73 glyph: 0x69 \151
- 0x6a, // #74 glyph: 0x6a \152
- 0x6b, // #75 glyph: 0x6b \153
- 0x6c, // #76 glyph: 0x6c \154
- 0x6d, // #77 glyph: 0x6d \155
- 0x6e, // #78 glyph: 0x6e \156
- 0x6f, // #79 glyph: 0x6f \157
- 0x70, // #80 glyph: 0x70 \160
- 0x71, // #81 glyph: 0x71 \161
- 0x72, // #82 glyph: 0x72 \162
- 0x73, // #83 glyph: 0x73 \163
- 0x74, // #84 glyph: 0x74 \164
- 0x75, // #85 glyph: 0x75 \165
- 0x76, // #86 glyph: 0x76 \166
- 0x77, // #87 glyph: 0x77 \167
- 0x78, // #88 glyph: 0x78 \170
- 0x79, // #89 glyph: 0x79 \171
- 0x7a, // #90 glyph: 0x7a \172
- 0x7b, // #91 glyph: 0x7b \173
- 0x7c, // #92 glyph: 0x7c \174
- 0x7d, // #93 glyph: 0x7d \175
- 0x7e, // #94 glyph: 0x7e \176
- 0xa1, // #95 glyph: 0xa1 \241
- 0xa2, // #96 glyph: 0xa2 \242
- 0xa3, // #97 glyph: 0xa3 \243
- 0xa4, // #98 glyph: 0xa4 \244
- 0xa5, // #99 glyph: 0xa5 \245
- 0xa6, // #100 glyph: 0xa6 \246
- 0xa7, // #101 glyph: 0xa7 \247
- 0xa8, // #102 glyph: 0xa8 \250
- 0xa9, // #103 glyph: 0xa9 \251
- 0xaa, // #104 glyph: 0xaa \252
- 0xab, // #105 glyph: 0xab \253
- 0xac, // #106 glyph: 0xac \254
- 0xae, // #107 glyph: 0xae \256
- 0xaf, // #108 glyph: 0xaf \257
- 0xb0, // #109 glyph: 0xb0 \260
- 0xb1, // #110 glyph: 0xb1 \261
- 0xb2, // #111 glyph: 0xb2 \262
- 0xb3, // #112 glyph: 0xb3 \263
- 0xb4, // #113 glyph: 0xb4 \264
- 0xb5, // #114 glyph: 0xb5 \265
- 0xb6, // #115 glyph: 0xb6 \266
- 0xb7, // #116 glyph: 0xb7 \267
- 0xb8, // #117 glyph: 0xb8 \270
- 0xb9, // #118 glyph: 0xb9 \271
- 0xba, // #119 glyph: 0xba \272
- 0xbb, // #120 glyph: 0xbb \273
- 0xbc, // #121 glyph: 0xbc \274
- 0xbd, // #122 glyph: 0xbd \275
- 0xbe, // #123 glyph: 0xbe \276
- 0xbf, // #124 glyph: 0xbf \277
- 0xc0, // #125 glyph: 0xc0 \300
- 0xc1, // #126 glyph: 0xc1 \301
- 0xc2, // #127 glyph: 0xc2 \302
- 0xc3, // #128 glyph: 0xc3 \303
- 0xc4, // #129 glyph: 0xc4 \304
- 0xc5, // #130 glyph: 0xc5 \305
- 0xc6, // #131 glyph: 0xc6 \306
- 0xc7, // #132 glyph: 0xc7 \307
- 0xc8, // #133 glyph: 0xc8 \310
- 0xc9, // #134 glyph: 0xc9 \311
- 0xca, // #135 glyph: 0xca \312
- 0xcb, // #136 glyph: 0xcb \313
- 0xcc, // #137 glyph: 0xcc \314
- 0xcd, // #138 glyph: 0xcd \315
- 0xce, // #139 glyph: 0xce \316
- 0xcf, // #140 glyph: 0xcf \317
- 0xd0, // #141 glyph: 0xd0 \320
- 0xd1, // #142 glyph: 0xd1 \321
- 0xd2, // #143 glyph: 0xd2 \322
- 0xd3, // #144 glyph: 0xd3 \323
- 0xd4, // #145 glyph: 0xd4 \324
- 0xd5, // #146 glyph: 0xd5 \325
- 0xd6, // #147 glyph: 0xd6 \326
- 0xd7, // #148 glyph: 0xd7 \327
- 0xd8, // #149 glyph: 0xd8 \330
- 0xd9, // #150 glyph: 0xd9 \331
- 0xda, // #151 glyph: 0xda \332
- 0xdb, // #152 glyph: 0xdb \333
- 0xdc, // #153 glyph: 0xdc \334
- 0xdd, // #154 glyph: 0xdd \335
- 0xde, // #155 glyph: 0xde \336
- 0xdf, // #156 glyph: 0xdf \337
- 0xe0, // #157 glyph: 0xe0 \340
- 0xe1, // #158 glyph: 0xe1 \341
- 0xe2, // #159 glyph: 0xe2 \342
- 0xe3, // #160 glyph: 0xe3 \343
- 0xe4, // #161 glyph: 0xe4 \344
- 0xe5, // #162 glyph: 0xe5 \345
- 0xe6, // #163 glyph: 0xe6 \346
- 0xe7, // #164 glyph: 0xe7 \347
- 0xe8, // #165 glyph: 0xe8 \350
- 0xe9, // #166 glyph: 0xe9 \351
- 0xea, // #167 glyph: 0xea \352
- 0xeb, // #168 glyph: 0xeb \353
- 0xec, // #169 glyph: 0xec \354
- 0xed, // #170 glyph: 0xed \355
- 0xee, // #171 glyph: 0xee \356
- 0xef, // #172 glyph: 0xef \357
- 0xf0, // #173 glyph: 0xf0 \360
- 0xf1, // #174 glyph: 0xf1 \361
- 0xf2, // #175 glyph: 0xf2 \362
- 0xf3, // #176 glyph: 0xf3 \363
- 0xf4, // #177 glyph: 0xf4 \364
- 0xf5, // #178 glyph: 0xf5 \365
- 0xf6, // #179 glyph: 0xf6 \366
- 0xf7, // #180 glyph: 0xf7 \367
- 0xf8, // #181 glyph: 0xf8 \370
- 0xf9, // #182 glyph: 0xf9 \371
- 0xfa, // #183 glyph: 0xfa \372
- 0xfb, // #184 glyph: 0xfb \373
- 0xfc, // #185 glyph: 0xfc \374
- 0xfd, // #186 glyph: 0xfd \375
- 0xfe, // #187 glyph: 0xfe \376
- 0xff, // #188 glyph: 0xff \377
- 0x152, // #189 glyph: 0x8c \214
- 0x153, // #190 glyph: 0x9c \234
- 0x160, // #191 glyph: 0x8a \212
- 0x161, // #192 glyph: 0x9a \232
- 0x178, // #193 glyph: 0x9f \237
- 0x17d, // #194 glyph: 0x8e \216
- 0x17e, // #195 glyph: 0x9e \236
- 0x192, // #196 glyph: 0x83 \203
- 0x2c6, // #197 glyph: 0x88 \210
- 0x2dc, // #198 glyph: 0x98 \230
- 0x2013, // #199 glyph: 0x96 \226
- 0x2014, // #200 glyph: 0x97 \227
- 0x2018, // #201 glyph: 0x91 \221
- 0x2019, // #202 glyph: 0x92 \222
- 0x201a, // #203 glyph: 0x82 \202
- 0x201c, // #204 glyph: 0x93 \223
- 0x201d, // #205 glyph: 0x94 \224
- 0x201e, // #206 glyph: 0x84 \204
- 0x2020, // #207 glyph: 0x86 \206
- 0x2021, // #208 glyph: 0x87 \207
- 0x2022, // #209 glyph: 0x95 \225
- 0x2026, // #210 glyph: 0x85 \205
- 0x2030, // #211 glyph: 0x89 \211
- 0x2039, // #212 glyph: 0x8b \213
- 0x203a, // #213 glyph: 0x9b \233
- 0x20ac, // #214 glyph: 0x80 \200
- 0x2122 // #215 glyph: 0x99 \231
+ 0x0020, // [0] glyph: 0x0020 \040 space
+ 0x0021, // [1] glyph: 0x0021 \041 exclam
+ 0x0022, // [2] glyph: 0x0022 \042 quotedbl
+ 0x0023, // [3] glyph: 0x0023 \043 numbersign
+ 0x0024, // [4] glyph: 0x0024 \044 dollar
+ 0x0025, // [5] glyph: 0x0025 \045 percent
+ 0x0026, // [6] glyph: 0x0026 \046 ampersand
+ 0x0027, // [7] glyph: 0x0027 \047 quotesingle
+ 0x0028, // [8] glyph: 0x0028 \050 parenleft
+ 0x0029, // [9] glyph: 0x0029 \051 parenright
+ 0x002a, // [10] glyph: 0x002a \052 asterisk
+ 0x002b, // [11] glyph: 0x002b \053 plus
+ 0x002c, // [12] glyph: 0x002c \054 comma
+ 0x002d, // [13] glyph: 0x002d \055 hyphen
+ 0x002e, // [14] glyph: 0x002e \056 period
+ 0x002f, // [15] glyph: 0x002f \057 slash
+ 0x0030, // [16] glyph: 0x0030 \060 zero
+ 0x0031, // [17] glyph: 0x0031 \061 one
+ 0x0032, // [18] glyph: 0x0032 \062 two
+ 0x0033, // [19] glyph: 0x0033 \063 three
+ 0x0034, // [20] glyph: 0x0034 \064 four
+ 0x0035, // [21] glyph: 0x0035 \065 five
+ 0x0036, // [22] glyph: 0x0036 \066 six
+ 0x0037, // [23] glyph: 0x0037 \067 seven
+ 0x0038, // [24] glyph: 0x0038 \070 eight
+ 0x0039, // [25] glyph: 0x0039 \071 nine
+ 0x003a, // [26] glyph: 0x003a \072 colon
+ 0x003b, // [27] glyph: 0x003b \073 semicolon
+ 0x003c, // [28] glyph: 0x003c \074 less
+ 0x003d, // [29] glyph: 0x003d \075 equal
+ 0x003e, // [30] glyph: 0x003e \076 greater
+ 0x003f, // [31] glyph: 0x003f \077 question
+ 0x0040, // [32] glyph: 0x0040 \100 at
+ 0x0041, // [33] glyph: 0x0041 \101 A
+ 0x0042, // [34] glyph: 0x0042 \102 B
+ 0x0043, // [35] glyph: 0x0043 \103 C
+ 0x0044, // [36] glyph: 0x0044 \104 D
+ 0x0045, // [37] glyph: 0x0045 \105 E
+ 0x0046, // [38] glyph: 0x0046 \106 F
+ 0x0047, // [39] glyph: 0x0047 \107 G
+ 0x0048, // [40] glyph: 0x0048 \110 H
+ 0x0049, // [41] glyph: 0x0049 \111 I
+ 0x004a, // [42] glyph: 0x004a \112 J
+ 0x004b, // [43] glyph: 0x004b \113 K
+ 0x004c, // [44] glyph: 0x004c \114 L
+ 0x004d, // [45] glyph: 0x004d \115 M
+ 0x004e, // [46] glyph: 0x004e \116 N
+ 0x004f, // [47] glyph: 0x004f \117 O
+ 0x0050, // [48] glyph: 0x0050 \120 P
+ 0x0051, // [49] glyph: 0x0051 \121 Q
+ 0x0052, // [50] glyph: 0x0052 \122 R
+ 0x0053, // [51] glyph: 0x0053 \123 S
+ 0x0054, // [52] glyph: 0x0054 \124 T
+ 0x0055, // [53] glyph: 0x0055 \125 U
+ 0x0056, // [54] glyph: 0x0056 \126 V
+ 0x0057, // [55] glyph: 0x0057 \127 W
+ 0x0058, // [56] glyph: 0x0058 \130 X
+ 0x0059, // [57] glyph: 0x0059 \131 Y
+ 0x005a, // [58] glyph: 0x005a \132 Z
+ 0x005b, // [59] glyph: 0x005b \133 bracketleft
+ 0x005c, // [60] glyph: 0x005c \134 backslash
+ 0x005d, // [61] glyph: 0x005d \135 bracketright
+ 0x005e, // [62] glyph: 0x005e \136 asciicircum
+ 0x005f, // [63] glyph: 0x005f \137 underscore
+ 0x0060, // [64] glyph: 0x0060 \140 grave
+ 0x0061, // [65] glyph: 0x0061 \141 a
+ 0x0062, // [66] glyph: 0x0062 \142 b
+ 0x0063, // [67] glyph: 0x0063 \143 c
+ 0x0064, // [68] glyph: 0x0064 \144 d
+ 0x0065, // [69] glyph: 0x0065 \145 e
+ 0x0066, // [70] glyph: 0x0066 \146 f
+ 0x0067, // [71] glyph: 0x0067 \147 g
+ 0x0068, // [72] glyph: 0x0068 \150 h
+ 0x0069, // [73] glyph: 0x0069 \151 i
+ 0x006a, // [74] glyph: 0x006a \152 j
+ 0x006b, // [75] glyph: 0x006b \153 k
+ 0x006c, // [76] glyph: 0x006c \154 l
+ 0x006d, // [77] glyph: 0x006d \155 m
+ 0x006e, // [78] glyph: 0x006e \156 n
+ 0x006f, // [79] glyph: 0x006f \157 o
+ 0x0070, // [80] glyph: 0x0070 \160 p
+ 0x0071, // [81] glyph: 0x0071 \161 q
+ 0x0072, // [82] glyph: 0x0072 \162 r
+ 0x0073, // [83] glyph: 0x0073 \163 s
+ 0x0074, // [84] glyph: 0x0074 \164 t
+ 0x0075, // [85] glyph: 0x0075 \165 u
+ 0x0076, // [86] glyph: 0x0076 \166 v
+ 0x0077, // [87] glyph: 0x0077 \167 w
+ 0x0078, // [88] glyph: 0x0078 \170 x
+ 0x0079, // [89] glyph: 0x0079 \171 y
+ 0x007a, // [90] glyph: 0x007a \172 z
+ 0x007b, // [91] glyph: 0x007b \173 braceleft
+ 0x007c, // [92] glyph: 0x007c \174 bar
+ 0x007d, // [93] glyph: 0x007d \175 braceright
+ 0x007e, // [94] glyph: 0x007e \176 asciitilde
+ 0x00a1, // [95] glyph: 0x00a1 \241 exclamdown
+ 0x00a2, // [96] glyph: 0x00a2 \242 cent
+ 0x00a3, // [97] glyph: 0x00a3 \243 sterling
+ 0x00a4, // [98] glyph: 0x00a4 \244 currency
+ 0x00a5, // [99] glyph: 0x00a5 \245 yen
+ 0x00a6, // [100] glyph: 0x00a6 \246 brokenbar
+ 0x00a7, // [101] glyph: 0x00a7 \247 section
+ 0x00a8, // [102] glyph: 0x00a8 \250 dieresis
+ 0x00a9, // [103] glyph: 0x00a9 \251 copyright
+ 0x00aa, // [104] glyph: 0x00aa \252 ordfeminine
+ 0x00ab, // [105] glyph: 0x00ab \253 guillemotleft
+ 0x00ac, // [106] glyph: 0x00ac \254 logicalnot
+ 0x00ae, // [107] glyph: 0x00ae \256 registered
+ 0x00af, // [108] glyph: 0x00af \257 macron
+ 0x00b0, // [109] glyph: 0x00b0 \260 degree
+ 0x00b1, // [110] glyph: 0x00b1 \261 plusminus
+ 0x00b2, // [111] glyph: 0x00b2 \262 ...
[truncated message content] |
|
From: <vic...@us...> - 2021-02-05 16:44:26
|
Revision: 11887
http://sourceforge.net/p/foray/code/11887
Author: victormote
Date: 2021-02-05 16:44:24 +0000 (Fri, 05 Feb 2021)
Log Message:
-----------
1. Add glyph names to comment in code point section. 2. Regenerate the "standard" encoding" to include the glyph names.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 16:14:50 UTC (rev 11886)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 16:44:24 UTC (rev 11887)
@@ -118,7 +118,7 @@
/** The character column number in which column 2 begins in the "code
* points" comments. */
- private static final int CODE_POINTS_COLUMN_2 = 27;
+ private static final int CODE_POINTS_COLUMN_2 = 29;
/** The character column number in which column 1 begins in the "code
* points index" comments. */
@@ -408,7 +408,7 @@
out.write(eol);
// Write the glyph names.
- out.write(" public static final String[] sortedGlyphNames = {");
+ out.write(" private static final String[] GLYPH_NAMES = {");
out.write(eol);
for (int i = 0; i < this.glyphNames.size(); i++) {
final StringBuilder builder = new StringBuilder();
@@ -436,7 +436,7 @@
// Write the glyph name code points.
out.write(eol);
- out.write(" public static final short[] glyphIndexes = {");
+ out.write(" private static final short[] GLYPH_INDEXES = {");
out.write(eol);
for (int i = 0; i < this.glyphIndexes.length(); i++) {
final char index = this.glyphIndexes.charAt(i);
@@ -466,13 +466,23 @@
// Write the code points.
out.write(eol);
- out.write(" public static final char[] codePoints = {");
+ out.write(" /**");
out.write(eol);
+ out.write(" * The Unicode codepoints encoded in this encoding, sorted.");
+ out.write(eol);
+ out.write(" */");
+ out.write(eol);
+ out.write(" private static final char[] CODE_POINTS = {");
+ out.write(eol);
for (int i = 0; i < this.codePoints.length(); i++) {
+ final int codePoint = this.codePoints.intAt(i);
+ final int codePointIndex = this.codePointIndexes.intAt(i);
+ final int glyphIndex = this.glyphIndexes.indexOf((char) codePointIndex);
+ final String glyphName = this.glyphNames.get(glyphIndex);
+
final StringBuilder builder = new StringBuilder();
- final int index = this.codePoints.intAt(i);
builder.append(" 0x");
- builder.append(StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE));
+ builder.append(StringUtils.charToHexString((char) codePoint, true, EncodingParser.HEX_STRING_SIZE));
if (i < this.codePoints.length() - 1) {
builder.append(",");
}
@@ -481,11 +491,11 @@
builder.append(formatArrayIndex(i));
StringUtils.padSpaces(builder, EncodingParser.CODE_POINTS_COLUMN_2, 2);
builder.append(" glyph: 0x");
- builder.append(StringUtils.charToHexString((char) this.codePointIndexes.intAt(i), true,
- EncodingParser.HEX_STRING_SIZE));
+ builder.append(StringUtils.charToHexString((char) codePointIndex, true, EncodingParser.HEX_STRING_SIZE));
builder.append(" \\");
- builder.append(StringUtils.charToOctalString((char) this.codePointIndexes.intAt(i),
- EncodingParser.HEX_STRING_SIZE));
+ builder.append(StringUtils.charToOctalString((char) codePointIndex, EncodingParser.OCTAL_STRING_SIZE));
+ builder.append(" ");
+ builder.append(glyphName);
out.write(builder.toString());
out.write(eol);
}
@@ -494,7 +504,18 @@
// Write the code point indexes.
out.write(eol);
- out.write(" public static final char[] codePointIndexes = {\n");
+ out.write(" /**");
+ out.write(eol);
+ out.write(" * The array of encoded indexes that is parallel to {@link #CODE_POINTS}.");
+ out.write(eol);
+ out.write(" * For the codepoint found at {@link #CODE_POINTS}[n], the encoded value for that codepoint");
+ out.write(" is found at");
+ out.write(eol);
+ out.write(" * {@link #CODE_POINT_INDEXES}[n].");
+ out.write(eol);
+ out.write(" */");
+ out.write(eol);
+ out.write(" private static final char[] CODE_POINT_INDEXES = {\n");
for (int i = 0; i < this.codePointIndexes.length(); i++) {
final int index = this.codePointIndexes.intAt(i);
final StringBuilder builder = new StringBuilder();
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-02-05 16:14:50 UTC (rev 11886)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-02-05 16:44:24 UTC (rev 11887)
@@ -36,21 +36,21 @@
import java.io.Serializable;
/**
- * Class containing hard-coded values that represent the StandardEncoding
- * Encoding Vector documented at PLRM3, Appendix E.5.
- * It is identical to the StandardEncoding Encoding Vector documented at
- * PDF Reference, 5th Edition, Appendix D.1.
+ * Class containing hard-coded values that represent the StandardEncoding Encoding Vector documented at PLRM3,
+ * Appendix E.5.
+ * It is identical to the StandardEncoding Encoding Vector documented at PDF Reference, 5th Edition, Appendix D.1.
*
- * <p>The hard-coded values in this class were derived by running
- * {@link EncodingParser#main(String[])} with the following input
- * parameters:</p>
+ * <p>The hard-coded values in this class were derived by running {@link EncodingParser#main(String[])} with the
+ * following input parameters:</p>
* <ol>
- * <li>input-file: foray/foray-ps/resource/encoding/latin-ps.txt</li>
- * <li>column-number: 1</li>
- * <li>output-file: [some file]</li>
- * <li>glyph-lists: [null]</li>
+ * <li>(arg 0, input file) file:./resource/encoding/latin-ps.txt</li>
+ * <li>(arg 1, column-number) 1</li>
+ * <li>(arg 2, radix) 8
+ * <li>(arg 3, output-file) [some file]</li>
* </ol>
*
+ * @see "PostScript Language Reference, Third Edition, Appendix E.5."
+ * @see "PDF Reference, Sixth Edition (PDF Version 1.7), Appendix D.1."
*/
public final class EncodingStandard extends EncodingVector4a
implements Serializable {
@@ -58,618 +58,622 @@
/** Constant needed for serialization. */
public static final long serialVersionUID = 910770936726091423L;
-/*
- private static final String[] sortedGlyphNames = {
- "A", // #0 glyph: 0x41 \101
- "AE", // #1 glyph: 0xe1 \341
- "B", // #2 glyph: 0x42 \102
- "C", // #3 glyph: 0x43 \103
- "D", // #4 glyph: 0x44 \104
- "E", // #5 glyph: 0x45 \105
- "F", // #6 glyph: 0x46 \106
- "G", // #7 glyph: 0x47 \107
- "H", // #8 glyph: 0x48 \110
- "I", // #9 glyph: 0x49 \111
- "J", // #10 glyph: 0x4a \112
- "K", // #11 glyph: 0x4b \113
- "L", // #12 glyph: 0x4c \114
- "Lslash", // #13 glyph: 0xe8 \350
- "M", // #14 glyph: 0x4d \115
- "N", // #15 glyph: 0x4e \116
- "O", // #16 glyph: 0x4f \117
- "OE", // #17 glyph: 0xea \352
- "Oslash", // #18 glyph: 0xe9 \351
- "P", // #19 glyph: 0x50 \120
- "Q", // #20 glyph: 0x51 \121
- "R", // #21 glyph: 0x52 \122
- "S", // #22 glyph: 0x53 \123
- "T", // #23 glyph: 0x54 \124
- "U", // #24 glyph: 0x55 \125
- "V", // #25 glyph: 0x56 \126
- "W", // #26 glyph: 0x57 \127
- "X", // #27 glyph: 0x58 \130
- "Y", // #28 glyph: 0x59 \131
- "Z", // #29 glyph: 0x5a \132
- "a", // #30 glyph: 0x61 \141
- "acute", // #31 glyph: 0xc2 \302
- "ae", // #32 glyph: 0xf1 \361
- "ampersand", // #33 glyph: 0x26 \46
- "asciicircum", // #34 glyph: 0x5e \136
- "asciitilde", // #35 glyph: 0x7e \176
- "asterisk", // #36 glyph: 0x2a \52
- "at", // #37 glyph: 0x40 \100
- "b", // #38 glyph: 0x62 \142
- "backslash", // #39 glyph: 0x5c \134
- "bar", // #40 glyph: 0x7c \174
- "braceleft", // #41 glyph: 0x7b \173
- "braceright", // #42 glyph: 0x7d \175
- "bracketleft", // #43 glyph: 0x5b \133
- "bracketright", // #44 glyph: 0x5d \135
- "breve", // #45 glyph: 0xc6 \306
- "bullet", // #46 glyph: 0xb7 \267
- "c", // #47 glyph: 0x63 \143
- "caron", // #48 glyph: 0xcf \317
- "cedilla", // #49 glyph: 0xcb \313
- "cent", // #50 glyph: 0xa2 \242
- "circumflex", // #51 glyph: 0xc3 \303
- "colon", // #52 glyph: 0x3a \72
- "comma", // #53 glyph: 0x2c \54
- "currency", // #54 glyph: 0xa8 \250
- "d", // #55 glyph: 0x64 \144
- "dagger", // #56 glyph: 0xb2 \262
- "daggerdbl", // #57 glyph: 0xb3 \263
- "dieresis", // #58 glyph: 0xc8 \310
- "dollar", // #59 glyph: 0x24 \44
- "dotaccent", // #60 glyph: 0xc7 \307
- "dotlessi", // #61 glyph: 0xf5 \365
- "e", // #62 glyph: 0x65 \145
- "eight", // #63 glyph: 0x38 \70
- "ellipsis", // #64 glyph: 0xbc \274
- "emdash", // #65 glyph: 0xd0 \320
- "endash", // #66 glyph: 0xb1 \261
- "equal", // #67 glyph: 0x3d \75
- "exclam", // #68 glyph: 0x21 \41
- "exclamdown", // #69 glyph: 0xa1 \241
- "f", // #70 glyph: 0x66 \146
- "fi", // #71 glyph: 0xae \256
- "five", // #72 glyph: 0x35 \65
- "fl", // #73 glyph: 0xaf \257
- "florin", // #74 glyph: 0xa6 \246
- "four", // #75 glyph: 0x34 \64
- "fraction", // #76 glyph: 0xa4 \244
- "g", // #77 glyph: 0x67 \147
- "germandbls", // #78 glyph: 0xfb \373
- "grave", // #79 glyph: 0xc1 \301
- "greater", // #80 glyph: 0x3e \76
- "guillemotleft", // #81 glyph: 0xab \253
- "guillemotright", // #82 glyph: 0xbb \273
- "guilsinglleft", // #83 glyph: 0xac \254
- "guilsinglright", // #84 glyph: 0xad \255
- "h", // #85 glyph: 0x68 \150
- "hungarumlaut", // #86 glyph: 0xcd \315
- "hyphen", // #87 glyph: 0x2d \55
- "i", // #88 glyph: 0x69 \151
- "j", // #89 glyph: 0x6a \152
- "k", // #90 glyph: 0x6b \153
- "l", // #91 glyph: 0x6c \154
- "less", // #92 glyph: 0x3c \74
- "lslash", // #93 glyph: 0xf8 \370
- "m", // #94 glyph: 0x6d \155
- "macron", // #95 glyph: 0xc5 \305
- "n", // #96 glyph: 0x6e \156
- "nine", // #97 glyph: 0x39 \71
- "numbersign", // #98 glyph: 0x23 \43
- "o", // #99 glyph: 0x6f \157
- "oe", // #100 glyph: 0xfa \372
- "ogonek", // #101 glyph: 0xce \316
- "one", // #102 glyph: 0x31 \61
- "ordfeminine", // #103 glyph: 0xe3 \343
- "ordmasculine", // #104 glyph: 0xeb \353
- "oslash", // #105 glyph: 0xf9 \371
- "p", // #106 glyph: 0x70 \160
- "paragraph", // #107 glyph: 0xb6 \266
- "parenleft", // #108 glyph: 0x28 \50
- "parenright", // #109 glyph: 0x29 \51
- "percent", // #110 glyph: 0x25 \45
- "period", // #111 glyph: 0x2e \56
- "periodcentered", // #112 glyph: 0xb4 \264
- "perthousand", // #113 glyph: 0xbd \275
- "plus", // #114 glyph: 0x2b \53
- "q", // #115 glyph: 0x71 \161
- "question", // #116 glyph: 0x3f \77
- "questiondown", // #117 glyph: 0xbf \277
- "quotedbl", // #118 glyph: 0x22 \42
- "quotedblbase", // #119 glyph: 0xb9 \271
- "quotedblleft", // #120 glyph: 0xaa \252
- "quotedblright", // #121 glyph: 0xba \272
- "quoteleft", // #122 glyph: 0x60 \140
- "quoteright", // #123 glyph: 0x27 \47
- "quotesinglbase", // #124 glyph: 0xb8 \270
- "quotesingle", // #125 glyph: 0xa9 \251
- "r", // #126 glyph: 0x72 \162
- "ring", // #127 glyph: 0xca \312
- "s", // #128 glyph: 0x73 \163
- "section", // #129 glyph: 0xa7 \247
- "semicolon", // #130 glyph: 0x3b \73
- "seven", // #131 glyph: 0x37 \67
- "six", // #132 glyph: 0x36 \66
- "slash", // #133 glyph: 0x2f \57
- "space", // #134 glyph: 0x20 \40
- "sterling", // #135 glyph: 0xa3 \243
- "t", // #136 glyph: 0x74 \164
- "three", // #137 glyph: 0x33 \63
- "tilde", // #138 glyph: 0xc4 \304
- "two", // #139 glyph: 0x32 \62
- "u", // #140 glyph: 0x75 \165
- "underscore", // #141 glyph: 0x5f \137
- "v", // #142 glyph: 0x76 \166
- "w", // #143 glyph: 0x77 \167
- "x", // #144 glyph: 0x78 \170
- "y", // #145 glyph: 0x79 \171
- "yen", // #146 glyph: 0xa5 \245
- "z", // #147 glyph: 0x7a \172
- "zero" // #148 glyph: 0x30 \60
+ /*
+ private static final String[] GLYPH_NAMES = {
+ "A", // [0] glyph-index: 0x0041 \101
+ "AE", // [1] glyph-index: 0x00e1 \341
+ "B", // [2] glyph-index: 0x0042 \102
+ "C", // [3] glyph-index: 0x0043 \103
+ "D", // [4] glyph-index: 0x0044 \104
+ "E", // [5] glyph-index: 0x0045 \105
+ "F", // [6] glyph-index: 0x0046 \106
+ "G", // [7] glyph-index: 0x0047 \107
+ "H", // [8] glyph-index: 0x0048 \110
+ "I", // [9] glyph-index: 0x0049 \111
+ "J", // [10] glyph-index: 0x004a \112
+ "K", // [11] glyph-index: 0x004b \113
+ "L", // [12] glyph-index: 0x004c \114
+ "Lslash", // [13] glyph-index: 0x00e8 \350
+ "M", // [14] glyph-index: 0x004d \115
+ "N", // [15] glyph-index: 0x004e \116
+ "O", // [16] glyph-index: 0x004f \117
+ "OE", // [17] glyph-index: 0x00ea \352
+ "Oslash", // [18] glyph-index: 0x00e9 \351
+ "P", // [19] glyph-index: 0x0050 \120
+ "Q", // [20] glyph-index: 0x0051 \121
+ "R", // [21] glyph-index: 0x0052 \122
+ "S", // [22] glyph-index: 0x0053 \123
+ "T", // [23] glyph-index: 0x0054 \124
+ "U", // [24] glyph-index: 0x0055 \125
+ "V", // [25] glyph-index: 0x0056 \126
+ "W", // [26] glyph-index: 0x0057 \127
+ "X", // [27] glyph-index: 0x0058 \130
+ "Y", // [28] glyph-index: 0x0059 \131
+ "Z", // [29] glyph-index: 0x005a \132
+ "a", // [30] glyph-index: 0x0061 \141
+ "acute", // [31] glyph-index: 0x00c2 \302
+ "ae", // [32] glyph-index: 0x00f1 \361
+ "ampersand", // [33] glyph-index: 0x0026 \046
+ "asciicircum", // [34] glyph-index: 0x005e \136
+ "asciitilde", // [35] glyph-index: 0x007e \176
+ "asterisk", // [36] glyph-index: 0x002a \052
+ "at", // [37] glyph-index: 0x0040 \100
+ "b", // [38] glyph-index: 0x0062 \142
+ "backslash", // [39] glyph-index: 0x005c \134
+ "bar", // [40] glyph-index: 0x007c \174
+ "braceleft", // [41] glyph-index: 0x007b \173
+ "braceright", // [42] glyph-index: 0x007d \175
+ "bracketleft", // [43] glyph-index: 0x005b \133
+ "bracketright", // [44] glyph-index: 0x005d \135
+ "breve", // [45] glyph-index: 0x00c6 \306
+ "bullet", // [46] glyph-index: 0x00b7 \267
+ "c", // [47] glyph-index: 0x0063 \143
+ "caron", // [48] glyph-index: 0x00cf \317
+ "cedilla", // [49] glyph-index: 0x00cb \313
+ "cent", // [50] glyph-index: 0x00a2 \242
+ "circumflex", // [51] glyph-index: 0x00c3 \303
+ "colon", // [52] glyph-index: 0x003a \072
+ "comma", // [53] glyph-index: 0x002c \054
+ "currency", // [54] glyph-index: 0x00a8 \250
+ "d", // [55] glyph-index: 0x0064 \144
+ "dagger", // [56] glyph-index: 0x00b2 \262
+ "daggerdbl", // [57] glyph-index: 0x00b3 \263
+ "dieresis", // [58] glyph-index: 0x00c8 \310
+ "dollar", // [59] glyph-index: 0x0024 \044
+ "dotaccent", // [60] glyph-index: 0x00c7 \307
+ "dotlessi", // [61] glyph-index: 0x00f5 \365
+ "e", // [62] glyph-index: 0x0065 \145
+ "eight", // [63] glyph-index: 0x0038 \070
+ "ellipsis", // [64] glyph-index: 0x00bc \274
+ "emdash", // [65] glyph-index: 0x00d0 \320
+ "endash", // [66] glyph-index: 0x00b1 \261
+ "equal", // [67] glyph-index: 0x003d \075
+ "exclam", // [68] glyph-index: 0x0021 \041
+ "exclamdown", // [69] glyph-index: 0x00a1 \241
+ "f", // [70] glyph-index: 0x0066 \146
+ "fi", // [71] glyph-index: 0x00ae \256
+ "five", // [72] glyph-index: 0x0035 \065
+ "fl", // [73] glyph-index: 0x00af \257
+ "florin", // [74] glyph-index: 0x00a6 \246
+ "four", // [75] glyph-index: 0x0034 \064
+ "fraction", // [76] glyph-index: 0x00a4 \244
+ "g", // [77] glyph-index: 0x0067 \147
+ "germandbls", // [78] glyph-index: 0x00fb \373
+ "grave", // [79] glyph-index: 0x00c1 \301
+ "greater", // [80] glyph-index: 0x003e \076
+ "guillemotleft", // [81] glyph-index: 0x00ab \253
+ "guillemotright", // [82] glyph-index: 0x00bb \273
+ "guilsinglleft", // [83] glyph-index: 0x00ac \254
+ "guilsinglright", // [84] glyph-index: 0x00ad \255
+ "h", // [85] glyph-index: 0x0068 \150
+ "hungarumlaut", // [86] glyph-index: 0x00cd \315
+ "hyphen", // [87] glyph-index: 0x002d \055
+ "i", // [88] glyph-index: 0x0069 \151
+ "j", // [89] glyph-index: 0x006a \152
+ "k", // [90] glyph-index: 0x006b \153
+ "l", // [91] glyph-index: 0x006c \154
+ "less", // [92] glyph-index: 0x003c \074
+ "lslash", // [93] glyph-index: 0x00f8 \370
+ "m", // [94] glyph-index: 0x006d \155
+ "macron", // [95] glyph-index: 0x00c5 \305
+ "n", // [96] glyph-index: 0x006e \156
+ "nine", // [97] glyph-index: 0x0039 \071
+ "numbersign", // [98] glyph-index: 0x0023 \043
+ "o", // [99] glyph-index: 0x006f \157
+ "oe", // [100] glyph-index: 0x00fa \372
+ "ogonek", // [101] glyph-index: 0x00ce \316
+ "one", // [102] glyph-index: 0x0031 \061
+ "ordfeminine", // [103] glyph-index: 0x00e3 \343
+ "ordmasculine", // [104] glyph-index: 0x00eb \353
+ "oslash", // [105] glyph-index: 0x00f9 \371
+ "p", // [106] glyph-index: 0x0070 \160
+ "paragraph", // [107] glyph-index: 0x00b6 \266
+ "parenleft", // [108] glyph-index: 0x0028 \050
+ "parenright", // [109] glyph-index: 0x0029 \051
+ "percent", // [110] glyph-index: 0x0025 \045
+ "period", // [111] glyph-index: 0x002e \056
+ "periodcentered", // [112] glyph-index: 0x00b4 \264
+ "perthousand", // [113] glyph-index: 0x00bd \275
+ "plus", // [114] glyph-index: 0x002b \053
+ "q", // [115] glyph-index: 0x0071 \161
+ "question", // [116] glyph-index: 0x003f \077
+ "questiondown", // [117] glyph-index: 0x00bf \277
+ "quotedbl", // [118] glyph-index: 0x0022 \042
+ "quotedblbase", // [119] glyph-index: 0x00b9 \271
+ "quotedblleft", // [120] glyph-index: 0x00aa \252
+ "quotedblright", // [121] glyph-index: 0x00ba \272
+ "quoteleft", // [122] glyph-index: 0x0060 \140
+ "quoteright", // [123] glyph-index: 0x0027 \047
+ "quotesinglbase", // [124] glyph-index: 0x00b8 \270
+ "quotesingle", // [125] glyph-index: 0x00a9 \251
+ "r", // [126] glyph-index: 0x0072 \162
+ "ring", // [127] glyph-index: 0x00ca \312
+ "s", // [128] glyph-index: 0x0073 \163
+ "section", // [129] glyph-index: 0x00a7 \247
+ "semicolon", // [130] glyph-index: 0x003b \073
+ "seven", // [131] glyph-index: 0x0037 \067
+ "six", // [132] glyph-index: 0x0036 \066
+ "slash", // [133] glyph-index: 0x002f \057
+ "space", // [134] glyph-index: 0x0020 \040
+ "sterling", // [135] glyph-index: 0x00a3 \243
+ "t", // [136] glyph-index: 0x0074 \164
+ "three", // [137] glyph-index: 0x0033 \063
+ "tilde", // [138] glyph-index: 0x00c4 \304
+ "two", // [139] glyph-index: 0x0032 \062
+ "u", // [140] glyph-index: 0x0075 \165
+ "underscore", // [141] glyph-index: 0x005f \137
+ "v", // [142] glyph-index: 0x0076 \166
+ "w", // [143] glyph-index: 0x0077 \167
+ "x", // [144] glyph-index: 0x0078 \170
+ "y", // [145] glyph-index: 0x0079 \171
+ "yen", // [146] glyph-index: 0x00a5 \245
+ "z", // [147] glyph-index: 0x007a \172
+ "zero" // [148] glyph-index: 0x0030 \060
};
- private static final short[] glyphIndexes = {
- 0x41, // #0
- 0xe1, // #1
- 0x42, // #2
- 0x43, // #3
- 0x44, // #4
- 0x45, // #5
- 0x46, // #6
- 0x47, // #7
- 0x48, // #8
- 0x49, // #9
- 0x4a, // #10
- 0x4b, // #11
- 0x4c, // #12
- 0xe8, // #13
- 0x4d, // #14
- 0x4e, // #15
- 0x4f, // #16
- 0xea, // #17
- 0xe9, // #18
- 0x50, // #19
- 0x51, // #20
- 0x52, // #21
- 0x53, // #22
- 0x54, // #23
- 0x55, // #24
- 0x56, // #25
- 0x57, // #26
- 0x58, // #27
- 0x59, // #28
- 0x5a, // #29
- 0x61, // #30
- 0xc2, // #31
- 0xf1, // #32
- 0x26, // #33
- 0x5e, // #34
- 0x7e, // #35
- 0x2a, // #36
- 0x40, // #37
- 0x62, // #38
- 0x5c, // #39
- 0x7c, // #40
- 0x7b, // #41
- 0x7d, // #42
- 0x5b, // #43
- 0x5d, // #44
- 0xc6, // #45
- 0xb7, // #46
- 0x63, // #47
- 0xcf, // #48
- 0xcb, // #49
- 0xa2, // #50
- 0xc3, // #51
- 0x3a, // #52
- 0x2c, // #53
- 0xa8, // #54
- 0x64, // #55
- 0xb2, // #56
- 0xb3, // #57
- 0xc8, // #58
- 0x24, // #59
- 0xc7, // #60
- 0xf5, // #61
- 0x65, // #62
- 0x38, // #63
- 0xbc, // #64
- 0xd0, // #65
- 0xb1, // #66
- 0x3d, // #67
- 0x21, // #68
- 0xa1, // #69
- 0x66, // #70
- 0xae, // #71
- 0x35, // #72
- 0xaf, // #73
- 0xa6, // #74
- 0x34, // #75
- 0xa4, // #76
- 0x67, // #77
- 0xfb, // #78
- 0xc1, // #79
- 0x3e, // #80
- 0xab, // #81
- 0xbb, // #82
- 0xac, // #83
- 0xad, // #84
- 0x68, // #85
- 0xcd, // #86
- 0x2d, // #87
- 0x69, // #88
- 0x6a, // #89
- 0x6b, // #90
- 0x6c, // #91
- 0x3c, // #92
- 0xf8, // #93
- 0x6d, // #94
- 0xc5, // #95
- 0x6e, // #96
- 0x39, // #97
- 0x23, // #98
- 0x6f, // #99
- 0xfa, // #100
- 0xce, // #101
- 0x31, // #102
- 0xe3, // #103
- 0xeb, // #104
- 0xf9, // #105
- 0x70, // #106
- 0xb6, // #107
- 0x28, // #108
- 0x29, // #109
- 0x25, // #110
- 0x2e, // #111
- 0xb4, // #112
- 0xbd, // #113
- 0x2b, // #114
- 0x71, // #115
- 0x3f, // #116
- 0xbf, // #117
- 0x22, // #118
- 0xb9, // #119
- 0xaa, // #120
- 0xba, // #121
- 0x60, // #122
- 0x27, // #123
- 0xb8, // #124
- 0xa9, // #125
- 0x72, // #126
- 0xca, // #127
- 0x73, // #128
- 0xa7, // #129
- 0x3b, // #130
- 0x37, // #131
- 0x36, // #132
- 0x2f, // #133
- 0x20, // #134
- 0xa3, // #135
- 0x74, // #136
- 0x33, // #137
- 0xc4, // #138
- 0x32, // #139
- 0x75, // #140
- 0x5f, // #141
- 0x76, // #142
- 0x77, // #143
- 0x78, // #144
- 0x79, // #145
- 0xa5, // #146
- 0x7a, // #147
- 0x30 // #148
+ private static final short[] GLYPH_INDEXES = {
+ 0x0041, // [0] \101 A
+ 0x00e1, // [1] \341 AE
+ 0x0042, // [2] \102 B
+ 0x0043, // [3] \103 C
+ 0x0044, // [4] \104 D
+ 0x0045, // [5] \105 E
+ 0x0046, // [6] \106 F
+ 0x0047, // [7] \107 G
+ 0x0048, // [8] \110 H
+ 0x0049, // [9] \111 I
+ 0x004a, // [10] \112 J
+ 0x004b, // [11] \113 K
+ 0x004c, // [12] \114 L
+ 0x00e8, // [13] \350 Lslash
+ 0x004d, // [14] \115 M
+ 0x004e, // [15] \116 N
+ 0x004f, // [16] \117 O
+ 0x00ea, // [17] \352 OE
+ 0x00e9, // [18] \351 Oslash
+ 0x0050, // [19] \120 P
+ 0x0051, // [20] \121 Q
+ 0x0052, // [21] \122 R
+ 0x0053, // [22] \123 S
+ 0x0054, // [23] \124 T
+ 0x0055, // [24] \125 U
+ 0x0056, // [25] \126 V
+ 0x0057, // [26] \127 W
+ 0x0058, // [27] \130 X
+ 0x0059, // [28] \131 Y
+ 0x005a, // [29] \132 Z
+ 0x0061, // [30] \141 a
+ 0x00c2, // [31] \302 acute
+ 0x00f1, // [32] \361 ae
+ 0x0026, // [33] \046 ampersand
+ 0x005e, // [34] \136 asciicircum
+ 0x007e, // [35] \176 asciitilde
+ 0x002a, // [36] \052 asterisk
+ 0x0040, // [37] \100 at
+ 0x0062, // [38] \142 b
+ 0x005c, // [39] \134 backslash
+ 0x007c, // [40] \174 bar
+ 0x007b, // [41] \173 braceleft
+ 0x007d, // [42] \175 braceright
+ 0x005b, // [43] \133 bracketleft
+ 0x005d, // [44] \135 bracketright
+ 0x00c6, // [45] \306 breve
+ 0x00b7, // [46] \267 bullet
+ 0x0063, // [47] \143 c
+ 0x00cf, // [48] \317 caron
+ 0x00cb, // [49] \313 cedilla
+ 0x00a2, // [50] \242 cent
+ 0x00c3, // [51] \303 circumflex
+ 0x003a, // [52] \072 colon
+ 0x002c, // [53] \054 comma
+ 0x00a8, // [54] \250 currency
+ 0x0064, // [55] \144 d
+ 0x00b2, // [56] \262 dagger
+ 0x00b3, // [57] \263 daggerdbl
+ 0x00c8, // [58] \310 dieresis
+ 0x0024, // [59] \044 dollar
+ 0x00c7, // [60] \307 dotaccent
+ 0x00f5, // [61] \365 dotlessi
+ 0x0065, // [62] \145 e
+ 0x0038, // [63] \070 eight
+ 0x00bc, // [64] \274 ellipsis
+ 0x00d0, // [65] \320 emdash
+ 0x00b1, // [66] \261 endash
+ 0x003d, // [67] \075 equal
+ 0x0021, // [68] \041 exclam
+ 0x00a1, // [69] \241 exclamdown
+ 0x0066, // [70] \146 f
+ 0x00ae, // [71] \256 fi
+ 0x0035, // [72] \065 five
+ 0x00af, // [73] \257 fl
+ 0x00a6, // [74] \246 florin
+ 0x0034, // [75] \064 four
+ 0x00a4, // [76] \244 fraction
+ 0x0067, // [77] \147 g
+ 0x00fb, // [78] \373 germandbls
+ 0x00c1, // [79] \301 grave
+ 0x003e, // [80] \076 greater
+ 0x00ab, // [81] \253 guillemotleft
+ 0x00bb, // [82] \273 guillemotright
+ 0x00ac, // [83] \254 guilsinglleft
+ 0x00ad, // [84] \255 guilsinglright
+ 0x0068, // [85] \150 h
+ 0x00cd, // [86] \315 hungarumlaut
+ 0x002d, // [87] \055 hyphen
+ 0x0069, // [88] \151 i
+ 0x006a, // [89] \152 j
+ 0x006b, // [90] \153 k
+ 0x006c, // [91] \154 l
+ 0x003c, // [92] \074 less
+ 0x00f8, // [93] \370 lslash
+ 0x006d, // [94] \155 m
+ 0x00c5, // [95] \305 macron
+ 0x006e, // [96] \156 n
+ 0x0039, // [97] \071 nine
+ 0x0023, // [98] \043 numbersign
+ 0x006f, // [99] \157 o
+ 0x00fa, // [100] \372 oe
+ 0x00ce, // [101] \316 ogonek
+ 0x0031, // [102] \061 one
+ 0x00e3, // [103] \343 ordfeminine
+ 0x00eb, // [104] \353 ordmasculine
+ 0x00f9, // [105] \371 oslash
+ 0x0070, // [106] \160 p
+ 0x00b6, // [107] \266 paragraph
+ 0x0028, // [108] \050 parenleft
+ 0x0029, // [109] \051 parenright
+ 0x0025, // [110] \045 percent
+ 0x002e, // [111] \056 period
+ 0x00b4, // [112] \264 periodcentered
+ 0x00bd, // [113] \275 perthousand
+ 0x002b, // [114] \053 plus
+ 0x0071, // [115] \161 q
+ 0x003f, // [116] \077 question
+ 0x00bf, // [117] \277 questiondown
+ 0x0022, // [118] \042 quotedbl
+ 0x00b9, // [119] \271 quotedblbase
+ 0x00aa, // [120] \252 quotedblleft
+ 0x00ba, // [121] \272 quotedblright
+ 0x0060, // [122] \140 quoteleft
+ 0x0027, // [123] \047 quoteright
+ 0x00b8, // [124] \270 quotesinglbase
+ 0x00a9, // [125] \251 quotesingle
+ 0x0072, // [126] \162 r
+ 0x00ca, // [127] \312 ring
+ 0x0073, // [128] \163 s
+ 0x00a7, // [129] \247 section
+ 0x003b, // [130] \073 semicolon
+ 0x0037, // [131] \067 seven
+ 0x0036, // [132] \066 six
+ 0x002f, // [133] \057 slash
+ 0x0020, // [134] \040 space
+ 0x00a3, // [135] \243 sterling
+ 0x0074, // [136] \164 t
+ 0x0033, // [137] \063 three
+ 0x00c4, // [138] \304 tilde
+ 0x0032, // [139] \062 two
+ 0x0075, // [140] \165 u
+ 0x005f, // [141] \137 underscore
+ 0x0076, // [142] \166 v
+ 0x0077, // [143] \167 w
+ 0x0078, // [144] \170 x
+ 0x0079, // [145] \171 y
+ 0x00a5, // [146] \245 yen
+ 0x007a, // [147] \172 z
+ 0x0030 // [148] \060 zero
};
*/
- /** The Unicode codepoints encoded in this encoding. */
+ /**
+ * The Unicode codepoints encoded in this encoding, sorted.
+ */
private static final char[] CODE_POINTS = {
- 0x20, // #0 glyph: 0x20 \40
- 0x21, // #1 glyph: 0x21 \41
- 0x22, // #2 glyph: 0x22 \42
- 0x23, // #3 glyph: 0x23 \43
- 0x24, // #4 glyph: 0x24 \44
- 0x25, // #5 glyph: 0x25 \45
- 0x26, // #6 glyph: 0x26 \46
- 0x27, // #7 glyph: 0xa9 \251
- 0x28, // #8 glyph: 0x28 \50
- 0x29, // #9 glyph: 0x29 \51
- 0x2a, // #10 glyph: 0x2a \52
- 0x2b, // #11 glyph: 0x2b \53
- 0x2c, // #12 glyph: 0x2c \54
- 0x2d, // #13 glyph: 0x2d \55
- 0x2e, // #14 glyph: 0x2e \56
- 0x2f, // #15 glyph: 0x2f \57
- 0x30, // #16 glyph: 0x30 \60
- 0x31, // #17 glyph: 0x31 \61
- 0x32, // #18 glyph: 0x32 \62
- 0x33, // #19 glyph: 0x33 \63
- 0x34, // #20 glyph: 0x34 \64
- 0x35, // #21 glyph: 0x35 \65
- 0x36, // #22 glyph: 0x36 \66
- 0x37, // #23 glyph: 0x37 \67
- 0x38, // #24 glyph: 0x38 \70
- 0x39, // #25 glyph: 0x39 \71
- 0x3a, // #26 glyph: 0x3a \72
- 0x3b, // #27 glyph: 0x3b \73
- 0x3c, // #28 glyph: 0x3c \74
- 0x3d, // #29 glyph: 0x3d \75
- 0x3e, // #30 glyph: 0x3e \76
- 0x3f, // #31 glyph: 0x3f \77
- 0x40, // #32 glyph: 0x40 \100
- 0x41, // #33 glyph: 0x41 \101
- 0x42, // #34 glyph: 0x42 \102
- 0x43, // #35 glyph: 0x43 \103
- 0x44, // #36 glyph: 0x44 \104
- 0x45, // #37 glyph: 0x45 \105
- 0x46, // #38 glyph: 0x46 \106
- 0x47, // #39 glyph: 0x47 \107
- 0x48, // #40 glyph: 0x48 \110
- 0x49, // #41 glyph: 0x49 \111
- 0x4a, // #42 glyph: 0x4a \112
- 0x4b, // #43 glyph: 0x4b \113
- 0x4c, // #44 glyph: 0x4c \114
- 0x4d, // #45 glyph: 0x4d \115
- 0x4e, // #46 glyph: 0x4e \116
- 0x4f, // #47 glyph: 0x4f \117
- 0x50, // #48 glyph: 0x50 \120
- 0x51, // #49 glyph: 0x51 \121
- 0x52, // #50 glyph: 0x52 \122
- 0x53, // #51 glyph: 0x53 \123
- 0x54, // #52 glyph: 0x54 \124
- 0x55, // #53 glyph: 0x55 \125
- 0x56, // #54 glyph: 0x56 \126
- 0x57, // #55 glyph: 0x57 \127
- 0x58, // #56 glyph: 0x58 \130
- 0x59, // #57 glyph: 0x59 \131
- 0x5a, // #58 glyph: 0x5a \132
- 0x5b, // #59 glyph: 0x5b \133
- 0x5c, // #60 glyph: 0x5c \134
- 0x5d, // #61 glyph: 0x5d \135
- 0x5e, // #62 glyph: 0x5e \136
- 0x5f, // #63 glyph: 0x5f \137
- 0x60, // #64 glyph: 0xc1 \301
- 0x61, // #65 glyph: 0x61 \141
- 0x62, // #66 glyph: 0x62 \142
- 0x63, // #67 glyph: 0x63 \143
- 0x64, // #68 glyph: 0x64 \144
- 0x65, // #69 glyph: 0x65 \145
- 0x66, // #70 glyph: 0x66 \146
- 0x67, // #71 glyph: 0x67 \147
- 0x68, // #72 glyph: 0x68 \150
- 0x69, // #73 glyph: 0x69 \151
- 0x6a, // #74 glyph: 0x6a \152
- 0x6b, // #75 glyph: 0x6b \153
- 0x6c, // #76 glyph: 0x6c \154
- 0x6d, // #77 glyph: 0x6d \155
- 0x6e, // #78 glyph: 0x6e \156
- 0x6f, // #79 glyph: 0x6f \157
- 0x70, // #80 glyph: 0x70 \160
- 0x71, // #81 glyph: 0x71 \161
- 0x72, // #82 glyph: 0x72 \162
- 0x73, // #83 glyph: 0x73 \163
- 0x74, // #84 glyph: 0x74 \164
- 0x75, // #85 glyph: 0x75 \165
- 0x76, // #86 glyph: 0x76 \166
- 0x77, // #87 glyph: 0x77 \167
- 0x78, // #88 glyph: 0x78 \170
- 0x79, // #89 glyph: 0x79 \171
- 0x7a, // #90 glyph: 0x7a \172
- 0x7b, // #91 glyph: 0x7b \173
- 0x7c, // #92 glyph: 0x7c \174
- 0x7d, // #93 glyph: 0x7d \175
- 0x7e, // #94 glyph: 0x7e \176
- 0xa1, // #95 glyph: 0xa1 \241
- 0xa2, // #96 glyph: 0xa2 \242
- 0xa3, // #97 glyph: 0xa3 \243
- 0xa4, // #98 glyph: 0xa8 \250
- 0xa5, // #99 glyph: 0xa5 \245
- 0xa7, // #100 glyph: 0xa7 \247
- 0xa8, // #101 glyph: 0xc8 \310
- 0xaa, // #102 glyph: 0xe3 \343
- 0xab, // #103 glyph: 0xab \253
- 0xaf, // #104 glyph: 0xc5 \305
- 0xb4, // #105 glyph: 0xc2 \302
- 0xb6, // #106 glyph: 0xb6 \266
- 0xb7, // #107 glyph: 0xb4 \264
- 0xb8, // #108 glyph: 0xcb \313
- 0xba, // #109 glyph: 0xeb \353
- 0xbb, // #110 glyph: 0xbb \273
- 0xbf, // #111 glyph: 0xbf \277
- 0xc6, // #112 glyph: 0xe1 \341
- 0xd8, // #113 glyph: 0xe9 \351
- 0xdf, // #114 glyph: 0xfb \373
- 0xe6, // #115 glyph: 0xf1 \361
- 0xf8, // #116 glyph: 0xf9 \371
- 0x131, // #117 glyph: 0xf5 \365
- 0x141, // #118 glyph: 0xe8 \350
- 0x142, // #119 glyph: 0xf8 \370
- 0x152, // #120 glyph: 0xea \352
- 0x153, // #121 glyph: 0xfa \372
- 0x192, // #122 glyph: 0xa6 \246
- 0x2c6, // #123 glyph: 0xc3 \303
- 0x2c7, // #124 glyph: 0xcf \317
- 0x2d8, // #125 glyph: 0xc6 \306
- 0x2d9, // #126 glyph: 0xc7 \307
- 0x2da, // #127 glyph: 0xca \312
- 0x2db, // #128 glyph: 0xce \316
- 0x2dc, // #129 glyph: 0xc4 \304
- 0x2dd, // #130 glyph: 0xcd \315
- 0x2013, // #131 glyph: 0xb1 \261
- 0x2014, // #132 glyph: 0xd0 \320
- 0x2018, // #133 glyph: 0x60 \140
- 0x2019, // #134 glyph: 0x27 \47
- 0x201a, // #135 glyph: 0xb8 \270
- 0x201c, // #136 glyph: 0xaa \252
- 0x201d, // #137 glyph: 0xba \272
- 0x201e, // #138 glyph: 0xb9 \271
- 0x2020, // #139 glyph: 0xb2 \262
- 0x2021, // #140 glyph: 0xb3 \263
- 0x2022, // #141 glyph: 0xb7 \267
- 0x2026, // #142 glyph: 0xbc \274
- 0x2030, // #143 glyph: 0xbd \275
- 0x2039, // #144 glyph: 0xac \254
- 0x203a, // #145 glyph: 0xad \255
- 0x2044, // #146 glyph: 0xa4 \244
- 0xfb01, // #147 glyph: 0xae \256
- 0xfb02 // #148 glyph: 0xaf \257
+ 0x0020, // [0] glyph: 0x0020 \040 space
+ 0x0021, // [1] glyph: 0x0021 \041 exclam
+ 0x0022, // [2] glyph: 0x0022 \042 quotedbl
+ 0x0023, // [3] glyph: 0x0023 \043 numbersign
+ 0x0024, // [4] glyph: 0x0024 \044 dollar
+ 0x0025, // [5] glyph: 0x0025 \045 percent
+ 0x0026, // [6] glyph: 0x0026 \046 ampersand
+ 0x0027, // [7] glyph: 0x00a9 \251 quotesingle
+ 0x0028, // [8] glyph: 0x0028 \050 parenleft
+ 0x0029, // [9] glyph: 0x0029 \051 parenright
+ 0x002a, // [10] glyph: 0x002a \052 asterisk
+ 0x002b, // [11] glyph: 0x002b \053 plus
+ 0x002c, // [12] glyph: 0x002c \054 comma
+ 0x002d, // [13] glyph: 0x002d \055 hyphen
+ 0x002e, // [14] glyph: 0x002e \056 period
+ 0x002f, // [15] glyph: 0x002f \057 slash
+ 0x0030, // [16] glyph: 0x0030 \060 zero
+ 0x0031, // [17] glyph: 0x0031 \061 one
+ 0x0032, // [18] glyph: 0x0032 \062 two
+ 0x0033, // [19] glyph: 0x0033 \063 three
+ 0x0034, // [20] glyph: 0x0034 \064 four
+ 0x0035, // [21] glyph: 0x0035 \065 five
+ 0x0036, // [22] glyph: 0x0036 \066 six
+ 0x0037, // [23] glyph: 0x0037 \067 seven
+ 0x0038, // [24] glyph: 0x0038 \070 eight
+ 0x0039, // [25] glyph: 0x0039 \071 nine
+ 0x003a, // [26] glyph: 0x003a \072 colon
+ 0x003b, // [27] glyph: 0x003b \073 semicolon
+ 0x003c, // [28] glyph: 0x003c \074 less
+ 0x003d, // [29] glyph: 0x003d \075 equal
+ 0x003e, // [30] glyph: 0x003e \076 greater
+ 0x003f, // [31] glyph: 0x003f \077 question
+ 0x0040, // [32] glyph: 0x0040 \100 at
+ 0x0041, // [33] glyph: 0x0041 \101 A
+ 0x0042, // [34] glyph: 0x0042 \102 B
+ 0x0043, // [35] glyph: 0x0043 \103 C
+ 0x0044, // [36] glyph: 0x0044 \104 D
+ 0x0045, // [37] glyph: 0x0045 \105 E
+ 0x0046, // [38] glyph: 0x0046 \106 F
+ 0x0047, // [39] glyph: 0x0047 \107 G
+ 0x0048, // [40] glyph: 0x0048 \110 H
+ 0x0049, // [41] glyph: 0x0049 \111 I
+ 0x004a, // [42] glyph: 0x004a \112 J
+ 0x004b, // [43] glyph: 0x004b \113 K
+ 0x004c, // [44] glyph: 0x004c \114 L
+ 0x004d, // [45] glyph: 0x004d \115 M
+ 0x004e, // [46] glyph: 0x004e \116 N
+ 0x004f, // [47] glyph: 0x004f \117 O
+ 0x0050, // [48] glyph: 0x0050 \120 P
+ 0x0051, // [49] glyph: 0x0051 \121 Q
+ 0x0052, // [50] glyph: 0x0052 \122 R
+ 0x0053, // [51] glyph: 0x0053 \123 S
+ 0x0054, // [52] glyph: 0x0054 \124 T
+ 0x0055, // [53] glyph: 0x0055 \125 U
+ 0x0056, // [54] glyph: 0x0056 \126 V
+ 0x0057, // [55] glyph: 0x0057 \127 W
+ 0x0058, // [56] glyph: 0x0058 \130 X
+ 0x0059, // [57] glyph: 0x0059 \131 Y
+ 0x005a, // [58] glyph: 0x005a \132 Z
+ 0x005b, // [59] glyph: 0x005b \133 bracketleft
+ 0x005c, // [60] glyph: 0x005c \134 backslash
+ 0x005d, // [61] glyph: 0x005d \135 bracketright
+ 0x005e, // [62] glyph: 0x005e \136 asciicircum
+ 0x005f, // [63] glyph: 0x005f \137 underscore
+ 0x0060, // [64] glyph: 0x00c1 \301 grave
+ 0x0061, // [65] glyph: 0x0061 \141 a
+ 0x0062, // [66] glyph: 0x0062 \142 b
+ 0x0063, // [67] glyph: 0x0063 \143 c
+ 0x0064, // [68] glyph: 0x0064 \144 d
+ 0x0065, // [69] glyph: 0x0065 \145 e
+ 0x0066, // [70] glyph: 0x0066 \146 f
+ 0x0067, // [71] glyph: 0x0067 \147 g
+ 0x0068, // [72] glyph: 0x0068 \150 h
+ 0x0069, // [73] glyph: 0x0069 \151 i
+ 0x006a, // [74] glyph: 0x006a \152 j
+ 0x006b, // [75] glyph: 0x006b \153 k
+ 0x006c, // [76] glyph: 0x006c \154 l
+ 0x006d, // [77] glyph: 0x006d \155 m
+ 0x006e, // [78] glyph: 0x006e \156 n
+ 0x006f, // [79] glyph: 0x006f \157 o
+ 0x0070, // [80] glyph: 0x0070 \160 p
+ 0x0071, // [81] glyph: 0x0071 \161 q
+ 0x0072, // [82] glyph: 0x0072 \162 r
+ 0x0073, // [83] glyph: 0x0073 \163 s
+ 0x0074, // [84] glyph: 0x0074 \164 t
+ 0x0075, // [85] glyph: 0x0075 \165 u
+ 0x0076, // [86] glyph: 0x0076 \166 v
+ 0x0077, // [87] glyph: 0x0077 \167 w
+ 0x0078, // [88] glyph: 0x0078 \170 x
+ 0x0079, // [89] glyph: 0x0079 \171 y
+ 0x007a, // [90] glyph: 0x007a \172 z
+ 0x007b, // [91] glyph: 0x007b \173 braceleft
+ 0x007c, // [92] glyph: 0x007c \174 bar
+ 0x007d, // [93] glyph: 0x007d \175 braceright
+ 0x007e, // [94] glyph: 0x007e \176 asciitilde
+ 0x00a1, // [95] glyph: 0x00a1 \241 exclamdown
+ 0x00a2, // [96] glyph: 0x00a2 \242 cent
+ 0x00a3, // [97] glyph: 0x00a3 \243 sterling
+ 0x00a4, // [98] glyph: 0x00a8 \250 currency
+ 0x00a5, // [99] glyph: 0x00a5 \245 yen
+ 0x00a7, // [100] glyph: 0x00a7 \247 section
+ 0x00a8, // [101] glyph: 0x00c8 \310 dieresis
+ 0x00aa, // [102] glyph: 0x00e3 \343 ordfeminine
+ 0x00ab, // [103] glyph: 0x00ab \253 guillemotleft
+ 0x00af, // [104] glyph: 0x00c5 \305 macron
+ 0x00b4, // [105] glyph: 0x00c2 \302 acute
+ 0x00b6, // [106] glyph: 0x00b6 \266 paragraph
+ 0x00b7, // [107] glyph: 0x00b4 \264 periodcentered
+ 0x00b8, // [108] glyph: 0x00cb \313 cedilla
+ 0x00ba, // [109] glyph: 0x00eb \353 ordmasculine
+ 0x00bb, // [110] glyph: 0x00bb \273 guillemotright
+ 0x00bf, // [111] glyph: 0x00bf \277 questiondown
+ 0x00c6, // [112] glyph: 0x00e1 \341 AE
+ 0x00d8, // [113] glyph: 0x00e9 \351 Oslash
+ 0x00df, // [114] glyph: 0x00fb \373 germandbls
+ 0x00e6, // [115] glyph: 0x00f1 \361 ae
+ 0x00f8, // [116] glyph: 0x00f9 \371 oslash
+ 0x0131, // [117] glyph: 0x00f5 \365 dotlessi
+ 0x0141, // [118] glyph: 0x00e8 \350 Lslash
+ 0x0142, // [119] glyph: 0x00f8 \370 lslash
+ 0x0152, // [120] glyph: 0x00ea \352 OE
+ 0x0153, // [121] glyph: 0x00fa \372 oe
+ 0x0192, // [122] glyph: 0x00a6 \246 florin
+ 0x02c6, // [123] glyph: 0x00c3 \303 circumflex
+ 0x02c7, // [124] glyph: 0x00cf \317 caron
+ 0x02d8, // [125] glyph: 0x00c6 \306 breve
+ 0x02d9, // [126] glyph: 0x00c7 \307 dotaccent
+ 0x02da, // [127] glyph: 0x00ca \312 ring
+ 0x02db, // [128] glyph: 0x00ce \316 ogonek
+ 0x02dc, // [129] glyph: 0x00c4 \304 tilde
+ 0x02dd, // [130] glyph: 0x00cd \315 hungarumlaut
+ 0x2013, // [131] glyph: 0x00b1 \261 endash
+ 0x2014, // [132] glyph: 0x00d0 \320 emdash
+ 0x2018, // [133] glyph: 0x0060 \140 quoteleft
+ 0x2019, // [134] glyph: 0x0027 \047 quoteright
+ 0x201a, // [135] glyph: 0x00b8 \270 quotesinglbase
+ 0x201c, // [136] glyph: 0x00aa \252 quotedblleft
+ 0x201d, // [137] glyph: 0x00ba \272 quotedblright
+ 0x201e, // [138] glyph: 0x00b9 \271 quotedblbase
+ 0x2020, // [139] glyph: 0x00b2 \262 dagger
+ 0x2021, // [140] glyph: 0x00b3 \263 daggerdbl
+ 0x2022, // [141] glyph: 0x00b7 \267 bullet
+ 0x2026, // [142] glyph: 0x00bc \274 ellipsis
+ 0x2030, // [143] glyph: 0x00bd \275 perthousand
+ 0x2039, // [144] glyph: 0x00ac \254 guilsinglleft
+ 0x203a, // [145] glyph: 0x00ad \255 guilsinglright
+ 0x2044, // [146] glyph: 0x00a4 \244 fraction
+ 0xfb01, // [147] glyph: 0x00ae \256 fi
+ 0xfb02 // [148] glyph: 0x00af \257 fl
};
- /** The array of encoded indexes that is parallel to {@link #CODE_POINTS}.
- * For the codepoint found at {@link #CODE_POINTS}[n], the encoded value
- * for that codepoint is found at {@link #CODE_POINT_INDEXES}[n]. */
+ /**
+ * The array of encoded indexes that is parallel to {@link #CODE_POINTS}.
+ * For the codepoint found at {@link #CODE_POINTS}[n], the encoded value for that codepoint is found at
+ * {@link #CODE_POINT_INDEXES}[n].
+ */
private static final char[] CODE_POINT_INDEXES = {
- 0x20, // #0
- 0x21, // #1
- 0x22, // #2
- 0x23, // #3
- 0x24, // #4
- 0x25, // #5
- 0x26, // #6
- 0xa9, // #7
- 0x28, // #8
- 0x29, // #9
- 0x2a, // #10
- 0x2b, // #11
- 0x2c, // #12
- 0x2d, // #13
- 0x2e, // #14
- 0x2f, // #15
- 0x30, // #16
- 0x31, // #17
- 0x32, // #18
- 0x33, // #19
- 0x34, // #20
- 0x35, // #21
- 0x36, // #22
- 0x37, // #23
- 0x38, // #24
- 0x39, // #25
- 0x3a, // #26
- 0x3b, // #27
- 0x3c, // #28
- 0x3d, // #29
- 0x3e, // #30
- 0x3f, // #31
- 0x40, // #32
- 0x41, // #33
- 0x42, // #34
- 0x43, // #35
- 0x44, // #36
- 0x45, // #37
- 0x46, // #38
- 0x47, // #39
- 0x48, // #40
- 0x49, // #41
- 0x4a, // #42
- 0x4b, // #43
- 0x4c, // #44
- 0x4d, // #45
- 0x4e, // #46
- 0x4f, // #47
- 0x50, // #48
- 0x51, // #49
- 0x52, // #50
- 0x53, // #51
- 0x54, // #52
- 0x55, // #53
- 0x56, // #54
- 0x57, // #55
- 0x58, // #56
- 0x59, // #57
- 0x5a, // #58
- 0x5b, // #59
- 0x5c, // #60
- 0x5d, // #61
- 0x5e, // #62
- 0x5f, // #63
- 0xc1, // #64
- 0x61, // #65
- 0x62, // #66
- 0x63, // #67
- 0x64, // #68
- 0x65, // #69
- 0x66, // #70
- 0x67, // #71
- 0x68, // #72
- 0x69, // #73
- 0x6a, // #74
- 0x6b, // #75
- 0x6c, // #76
- 0x6d, // #77
- 0x6e, // #78
- 0x6f, // #79
- 0x70, // #80
- 0x71, // #81
- 0x72, // #82
- 0x73, // #83
- 0x74, // #84
- 0x75, // #85
- 0x76, // #86
- 0x77, // #87
- 0x78, // #88
- 0x79, // #89
- 0x7a, // #90
- 0x7b, // #91
- 0x7c, // #92
- 0x7d, // #93
- 0x7e, // #94
- 0xa1, // #95
- 0xa2, // #96
- 0xa3, // #97
- 0xa8, // #98
- 0xa5, // #99
- 0xa7, // #100
- 0xc8, // #101
- 0xe3, // #102
- 0xab, // #103
- 0xc5, // #104
- 0xc2, // #105
- 0xb6, // #106
- 0xb4, // #107
- 0xcb, // #108
- 0xeb, // #109
- 0xbb, // #110
- 0xbf, // #111
- 0xe1, // #112
- 0xe9, // #113
- 0xfb, // #114
- 0xf1, // #115
- 0xf9, // #116
- 0xf5, // #117
- 0xe8, // #118
- 0xf8, // #119
- 0xea, // #120
- 0xfa, // #121
- 0xa6, // #122
- 0xc3, // #123
- 0xcf, // #124
- 0xc6, // #125
- 0xc7, // #126
- 0xca, // #127
- 0xce, // #128
- 0xc4, // #129
- 0xcd, // #130
- 0xb1, // #131
- 0xd0, // #132
- 0x60, // #133
- 0x27, // #134
- 0xb8, // #135
- 0xaa, // #136
- 0xba, // #137
- 0xb9, // #138
- 0xb2, // #139
- 0xb3, // #140
- 0xb7, // #141
- 0xbc, // #142
- 0xbd, // #143
- 0xac, // #144
- 0xad, // #145
- 0xa4, // #146
- 0xae, // #147
- 0xaf // #148
+ 0x0020, // [0]
+ 0x0021, // [1]
+ 0x0022, // [2]
+ 0x0023, // [3]
+ 0x0024, // [4]
+ 0x0025, // [5]
+ 0x0026, // [6]
+ 0x00a9, // [7]
+ 0x0028, // [8]
+ 0x0029, // [9]
+ 0x002a, // [10]
+ 0x002b, // [11]
+ 0x002c, // [12]
+ 0x002d, // [13]
+ 0x002e, // [14]
+ 0x002f, // [15]
+ 0x0030, // [16]
+ 0x0031, // [17]
+ 0x0032, // [18]
+ 0x0033, // [19]
+ 0x0034, // [20]
+ 0x0035, // [21]
+ 0x0036, // [22]
+ 0x0037, // [23]
+ 0x0038, // [24]
+ 0x0039, // [25]
+ 0x003a, // [26]
+ 0x003b, // [27]
+ 0x003c, // [28]
+ 0x003d, // [29]
+ 0x003e, // [30]
+ 0x003f, // [31]
+ 0x0040, // [32]
+ 0x0041, // [33]
+ 0x0042, // [34]
+ 0x0043, // [35]
+ 0x0044, // [36]
+ 0x0045, // [37]
+ 0x0046, // [38]
+ 0x0047, // [39]
+ 0x0048, // [40]
+ 0x0049, // [41]
+ 0x004a, // [42]
+ 0x004b, // [43]
+ 0x004c, // [44]
+ 0x004d, // [45]
+ 0x004e, // [46]
+ 0x004f, // [47]
+ 0x0050, // [48]
+ 0x0051, // [49]
+ 0x0052, // [50]
+ 0x0053, // [51]
+ 0x0054, // [52]
+ 0x0055, // [53]
+ 0x0056, // [54]
+ 0x0057, // [55]
+ 0x0058, // [56]
+ 0x0059, // [57]
+ 0x005a, // [58]
+ 0x005b, // [59]
+ 0x005c, // [60]
+ 0x005d, // [61]
+ 0x005e, // [62]
+ 0x005f, // [63]
+ 0x00c1, // [64]
+ 0x0061, // [65]
+ 0x0062, // [66]
+ 0x0063, // [67]
+ 0x0064, // [68]
+ 0x0065, // [69]
+ 0x0066, // [70]
+ 0x0067, // [71]
+ 0x0068, // [72]
+ 0x0069, // [73]
+ 0x006a, // [74]
+ 0x006b, // [75]
+ 0x006c, // [76]
+ 0x006d, // [77]
+ 0x006e, // [78]
+ 0x006f, // [79]
+ 0x0070, // [80]
+ 0x0071, // [81]
+ 0x0072, // [82]
+ 0x0073, // [83]
+ 0x0074, // [84]
+ 0x0075, // [85]
+ 0x0076, // [86]
+ 0x0077, // [87]
+ 0x0078, // [88]
+ 0x0079, // [89]
+ 0x007a, // [90]
+ 0x007b, // [91]
+ 0x007c, // [92]
+ 0x007d, // [93]
+ 0x007e, // [94]
+ 0x00a1, // [95]
+ 0x00a2, // [96]
+ 0x00a3, // [97]
+ 0x00a8, // [98]
+ 0x00a5, // [99]
+ 0x00a7, // [100]
+ 0x00c8, // [101]
+ 0x00e3, // [102]
+ 0x00ab, // [103]
+ 0x00c5, // [104]
+ 0x00c2, // [105]
+ 0x00b6, // [106]
+ 0x00b4, // [107]
+ 0x00cb, // [108]
+ 0x00eb, // [109]
+ 0x00bb, // [110]
+ 0x00bf, // [111]
+ 0x00e1, // [112]
+ 0x00e9, // [113]
+ 0x00fb, // [114]
+ 0x00f1, // [115]
+ 0x00f9, // [116]
+ 0x00f5, // [117]
+ 0x00e8, // [118]
+ 0x00f8, // [119]
+ 0x00ea, // [120]
+ 0x00fa, // [121]
+ 0x00a6, // [122]
+ 0x00c3, // [123]
+ 0x00cf, // [124]
+ 0x00c6, // [125]
+ 0x00c7, // [126]
+ 0x00ca, // [127]
+ 0x00ce, // [128]
+ 0x00c4, // [129]
+ 0x00cd, // [130]
+ 0x00b1, // [131]
+ 0x00d0, // [132]
+ 0x0060, // [133]
+ 0x0027, // [134]
+ 0x00b8, // [135]
+ 0x00aa, // [136]
+ 0x00ba, // [137]
+ 0x00b9, // [138]
+ 0x00b2, // [139]
+ 0x00b3, // [140]
+ 0x00b7, // [141]
+ 0x00bc, // [142]
+ 0x00bd, // [143]
+ 0x00ac, // [144]
+ 0x00ad, // [145]
+ 0x00a4, // [146]
+ 0x00ae, // [147]
+ 0x00af // [148]
};
/** The singleton instance. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-05 16:14:57
|
Revision: 11886
http://sourceforge.net/p/foray/code/11886
Author: victormote
Date: 2021-02-05 16:14:50 +0000 (Fri, 05 Feb 2021)
Log Message:
-----------
Use CharArrayBuilder to accumulate glyph indexes.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingParserTests.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 15:36:14 UTC (rev 11885)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 16:14:50 UTC (rev 11886)
@@ -29,11 +29,12 @@
package org.foray.ps.encode;
import org.foray.common.WellKnownConstants;
-import org.foray.common.primitive.CharacterUtils;
import org.foray.common.primitive.StringUtils;
+import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.common.url.UrlFactory;
+import org.axsl.common.sequence.CharSequenceMutable;
import org.axsl.common.sequence.IntSequenceMutable;
import org.axsl.ps.GlyphList;
import org.axsl.ps.PsException;
@@ -150,7 +151,7 @@
private List<String> glyphNames = new ArrayList<String>();
/** The parsed glyph indexes. */
- private List<Character> glyphIndexes = new ArrayList<Character>();
+ private CharArrayBuilder glyphIndexes = new CharArrayBuilder();
/** The parsed Unicode codepoints. */
private IntArrayBuilder codePoints = new IntArrayBuilder();
@@ -266,7 +267,7 @@
*/
private void processCurrentLine(final String line, final int arrayIndex) throws PsException {
this.glyphNames.add(StringUtils.EMPTY_STRING);
- this.glyphIndexes.add(Character.MIN_VALUE);
+ this.glyphIndexes.append(Character.MIN_VALUE);
this.codePoints.append(Integer.MIN_VALUE);
this.codePointIndexes.append(Character.MIN_VALUE);
@@ -285,7 +286,7 @@
if (index < 0) {
index = 0;
}
- this.glyphIndexes.set(arrayIndex, (char) index);
+ this.glyphIndexes.setCharAt(arrayIndex, (char) index);
}
/**
@@ -321,9 +322,9 @@
final String storeString = this.glyphNames.get(i);
this.glyphNames.set(i, this.glyphNames.get(i + 1));
this.glyphNames.set(i + 1, storeString);
- final Character storeChar = this.glyphIndexes.get(i);
- this.glyphIndexes.set(i, this.glyphIndexes.get(i + 1));
- this.glyphIndexes.set(i + 1, storeChar);
+ final Character storeChar = this.glyphIndexes.charAt(i);
+ this.glyphIndexes.setCharAt(i, this.glyphIndexes.charAt(i + 1));
+ this.glyphIndexes.setCharAt(i + 1, storeChar);
anyChanges = true;
}
}
@@ -371,7 +372,7 @@
glyphName);
if (codePoint != Character.MAX_VALUE) {
this.codePoints.setIntAt(i, codePoint);
- final char glyphIndex = this.glyphIndexes.get(i);
+ final char glyphIndex = this.glyphIndexes.charAt(i);
this.codePointIndexes.setIntAt(i, glyphIndex);
break;
}
@@ -422,9 +423,11 @@
builder.append(formatArrayIndex(i));
StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAMES_COLUMN_2, 1);
builder.append(" glyph-index: 0x");
- builder.append(StringUtils.charToHexString(this.glyphIndexes.get(i), true, EncodingParser.HEX_STRING_SIZE));
+ builder.append(StringUtils.charToHexString(this.glyphIndexes.charAt(i), true,
+ EncodingParser.HEX_STRING_SIZE));
builder.append(" \\");
- builder.append(StringUtils.charToOctalString(this.glyphIndexes.get(i), EncodingParser.OCTAL_STRING_SIZE));
+ builder.append(StringUtils.charToOctalString(this.glyphIndexes.charAt(i),
+ EncodingParser.OCTAL_STRING_SIZE));
out.write(builder.toString());
out.write(eol);
}
@@ -435,12 +438,12 @@
out.write(eol);
out.write(" public static final short[] glyphIndexes = {");
out.write(eol);
- for (int i = 0; i < this.glyphIndexes.size(); i++) {
- final char index = this.glyphIndexes.get(i);
+ for (int i = 0; i < this.glyphIndexes.length(); i++) {
+ final char index = this.glyphIndexes.charAt(i);
final StringBuilder builder = new StringBuilder();
builder.append(" 0x");
builder.append(StringUtils.charToHexString(index, true, EncodingParser.HEX_STRING_SIZE));
- if (i < this.glyphIndexes.size() - 1) {
+ if (i < this.glyphIndexes.length() - 1) {
builder.append(",");
}
StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_1, 2);
@@ -542,8 +545,8 @@
* Returns the glyph indexes.
* @return The glyph indexes.
*/
- public char[] getGlyphIndexes() {
- return CharacterUtils.toArray(this.glyphIndexes);
+ public CharSequenceMutable getGlyphIndexes() {
+ return this.glyphIndexes;
}
/**
Modified: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingParserTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingParserTests.java 2021-02-05 15:36:14 UTC (rev 11885)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingParserTests.java 2021-02-05 16:14:50 UTC (rev 11886)
@@ -64,17 +64,17 @@
/* Did we parse the right number of elements. Last element is on line 237. First 8 lines are blank. In the
* WinAnsi column, there are 13 unencoded characters. 237 - 8 - 13 = 216. */
Assert.assertEquals(216, parser.getGlyphNames().length);
- Assert.assertEquals(216, parser.getGlyphIndexes().length);
+ Assert.assertEquals(216, parser.getGlyphIndexes().length());
Assert.assertEquals(216, parser.getCodePoints().length());
Assert.assertEquals(216, parser.getCodePointIndexes().length());
/* Test the first item, as sorted in glyph name order. */
Assert.assertEquals("A", parser.getGlyphNames()[0]);
- Assert.assertEquals('\101', parser.getGlyphIndexes()[0]);
+ Assert.assertEquals('\101', parser.getGlyphIndexes().charAt(0));
/* Test the last item, as sorted in glyph name order. */
Assert.assertEquals("zero", parser.getGlyphNames()[215]);
- Assert.assertEquals('\060', parser.getGlyphIndexes()[215]);
+ Assert.assertEquals('\060', parser.getGlyphIndexes().charAt(215));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-05 15:36:17
|
Revision: 11885
http://sourceforge.net/p/foray/code/11885
Author: victormote
Date: 2021-02-05 15:36:14 +0000 (Fri, 05 Feb 2021)
Log Message:
-----------
1. Move padding logic to common, for reuse. 2. More cleanup of EncodingParser output.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java 2021-02-05 15:05:28 UTC (rev 11884)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java 2021-02-05 15:36:14 UTC (rev 11885)
@@ -464,4 +464,22 @@
return buffer.toString();
}
+ /**
+ * Appends spaces in a {@link StringBuilder} to a specified size.
+ * This is useful in some cases to format output.
+ * @param builder The builder to which spaces should (possibly) be added.
+ * @param minimumSize The minimum size of the builder after processing.
+ * @param minimumPad The minimum padding size that should be added.
+ * This will be honored even if it makes the builder longer than {@code minimumSize}.
+ */
+ public static void padSpaces(final StringBuilder builder, final int minimumSize, final int minimumPad) {
+ /* The String length + 1 is the next column that will be written if no padding is added. */
+ int spacesToPad = minimumSize - (builder.length() + 1);
+ spacesToPad = Math.max(spacesToPad, minimumPad);
+ while (spacesToPad > 0) {
+ builder.append(" ");
+ spacesToPad--;
+ }
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetParser.java 2021-02-05 15:05:28 UTC (rev 11884)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetParser.java 2021-02-05 15:36:14 UTC (rev 11885)
@@ -209,19 +209,20 @@
s = " public static final char[] characterSet = {\n";
out.write(s.getBytes());
for (int i = 0; i < this.characterSet.length(); i++) {
- s = " 0x";
- s = s + StringUtils.charToHexString(this.characterSet.charAt(i), true,
- CharSetParser.MINIMUM_CHAR_SIZE);
+ final StringBuilder builder = new StringBuilder();
+ builder.append(" 0x");
+ builder.append(StringUtils.charToHexString(this.characterSet.charAt(i), true,
+ CharSetParser.MINIMUM_CHAR_SIZE));
if (i < this.characterSet.length() - 1) {
- s = s + ",";
+ builder.append(",");
} else {
- s = s + " ";
+ builder.append(" ");
}
- s = s + " // " + EncodingParser.formatArrayIndex(i);
- s = EncodingParser.padSpaces(s, CharSetParser.DESIRED_COLUMN,
- CharSetParser.MINIMUM_PADDING_SIZE);
- s = s + this.glyphNames.get(i);
- s = s + "\n";
+ builder.append(" // ");
+ builder.append(EncodingParser.formatArrayIndex(i));
+ StringUtils.padSpaces(builder, CharSetParser.DESIRED_COLUMN, CharSetParser.MINIMUM_PADDING_SIZE);
+ builder.append(this.glyphNames.get(i));
+ builder.append("\n");
out.write(s.getBytes());
}
s = " };\n";
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 15:05:28 UTC (rev 11884)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 15:36:14 UTC (rev 11885)
@@ -410,21 +410,22 @@
out.write(" public static final String[] sortedGlyphNames = {");
out.write(eol);
for (int i = 0; i < this.glyphNames.size(); i++) {
- String s = " \"";
- s = s + this.glyphNames.get(i);
- s = s + "\"";
+ final StringBuilder builder = new StringBuilder();
+ builder.append(" \"");
+ builder.append(this.glyphNames.get(i));
+ builder.append("\"");
if (i < this.glyphNames.size() - 1) {
- s = s + ",";
+ builder.append(",");
}
- s = padSpaces(s, EncodingParser.GLYPH_NAMES_COLUMN_1, 2);
- s = s + "// " + formatArrayIndex(i);
- s = padSpaces(s, EncodingParser.GLYPH_NAMES_COLUMN_2, 1);
- s = s + " glyph-index: 0x"
- + StringUtils.charToHexString(this.glyphIndexes.get(i), true,
- EncodingParser.HEX_STRING_SIZE);
- s = s + " \\" + StringUtils.charToOctalString(this.glyphIndexes.get(i),
- EncodingParser.OCTAL_STRING_SIZE);
- out.write(s);
+ StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAMES_COLUMN_1, 2);
+ builder.append("// ");
+ builder.append(formatArrayIndex(i));
+ StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAMES_COLUMN_2, 1);
+ builder.append(" glyph-index: 0x");
+ builder.append(StringUtils.charToHexString(this.glyphIndexes.get(i), true, EncodingParser.HEX_STRING_SIZE));
+ builder.append(" \\");
+ builder.append(StringUtils.charToOctalString(this.glyphIndexes.get(i), EncodingParser.OCTAL_STRING_SIZE));
+ out.write(builder.toString());
out.write(eol);
}
out.write(" };");
@@ -436,22 +437,22 @@
out.write(eol);
for (int i = 0; i < this.glyphIndexes.size(); i++) {
final char index = this.glyphIndexes.get(i);
- String s = " ";
- s = s + "0x";
- s = s + StringUtils.charToHexString(index, true,
- EncodingParser.HEX_STRING_SIZE);
+ final StringBuilder builder = new StringBuilder();
+ builder.append(" 0x");
+ builder.append(StringUtils.charToHexString(index, true, EncodingParser.HEX_STRING_SIZE));
if (i < this.glyphIndexes.size() - 1) {
- s = s + ",";
+ builder.append(",");
}
- s = padSpaces(s, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_1, 2);
- s = s + "// " + formatArrayIndex(i);
- s = padSpaces(s, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_2, 1);
- s = s + "\\" + StringUtils.charToOctalString(index,
- EncodingParser.OCTAL_STRING_SIZE);
- s = padSpaces(s, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_3, 1);
- s = s + this.glyphNames.get(i);
- s = s + "\n";
- out.write(s);
+ StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_1, 2);
+ builder.append("// ");
+ builder.append(formatArrayIndex(i));
+ StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_2, 1);
+ builder.append("\\");
+ builder.append(StringUtils.charToOctalString(index, EncodingParser.OCTAL_STRING_SIZE));
+ StringUtils.padSpaces(builder, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_3, 1);
+ builder.append(this.glyphNames.get(i));
+ out.write(builder.toString());
+ out.write(eol);
}
out.write(" };");
out.write(eol);
@@ -465,21 +466,24 @@
out.write(" public static final char[] codePoints = {");
out.write(eol);
for (int i = 0; i < this.codePoints.length(); i++) {
+ final StringBuilder builder = new StringBuilder();
final int index = this.codePoints.intAt(i);
- String s = " ";
- s = s + "0x";
- s = s + StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE);
+ builder.append(" 0x");
+ builder.append(StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE));
if (i < this.codePoints.length() - 1) {
- s = s + ",";
+ builder.append(",");
}
- s = padSpaces(s, EncodingParser.CODE_POINTS_COLUMN_1, 2);
- s = s + "// " + formatArrayIndex(i);
- s = padSpaces(s, EncodingParser.CODE_POINTS_COLUMN_2, 2);
- s = s + " glyph: 0x" + StringUtils.charToHexString((char) this.codePointIndexes.intAt(i), true,
- EncodingParser.HEX_STRING_SIZE);
- s = s + " \\" + StringUtils.charToOctalString((char) this.codePointIndexes.intAt(i),
- EncodingParser.HEX_STRING_SIZE);
- out.write(s);
+ StringUtils.padSpaces(builder, EncodingParser.CODE_POINTS_COLUMN_1, 2);
+ builder.append("// ");
+ builder.append(formatArrayIndex(i));
+ StringUtils.padSpaces(builder, EncodingParser.CODE_POINTS_COLUMN_2, 2);
+ builder.append(" glyph: 0x");
+ builder.append(StringUtils.charToHexString((char) this.codePointIndexes.intAt(i), true,
+ EncodingParser.HEX_STRING_SIZE));
+ builder.append(" \\");
+ builder.append(StringUtils.charToOctalString((char) this.codePointIndexes.intAt(i),
+ EncodingParser.HEX_STRING_SIZE));
+ out.write(builder.toString());
out.write(eol);
}
out.write(" };");
@@ -490,16 +494,17 @@
out.write(" public static final char[] codePointIndexes = {\n");
for (int i = 0; i < this.codePointIndexes.length(); i++) {
final int index = this.codePointIndexes.intAt(i);
- String s = " ";
- s = s + "0x";
- s = s + StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE);
+ final StringBuilder builder = new StringBuilder();
+ builder.append(" 0x");
+ builder.append(StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE));
if (i < this.codePointIndexes.length() - 1) {
- s = s + ",";
+ builder.append(",");
}
- s = padSpaces(s, EncodingParser.CODE_POINTS_INDEX_1, 2);
- s = s + "// " + formatArrayIndex(i);
- s = s + "\n";
- out.write(s);
+ StringUtils.padSpaces(builder, EncodingParser.CODE_POINTS_INDEX_1, 2);
+ builder.append("// ");
+ builder.append(formatArrayIndex(i));
+ out.write(builder.toString());
+ out.write(eol);
}
out.write(" };");
out.write(eol);
@@ -509,28 +514,6 @@
}
/**
- * Pads spaces in the output to try to make it more readable.
- * @param string The pre-padded output line.
- * @param desiredColumn The column number up to which padding should be
- * added.
- * @param minimumPad The minimum padding size that should be added.
- * @return The padded String.
- */
- public static String padSpaces(final String string, final int desiredColumn,
- final int minimumPad) {
- /* The String length + 1 is the next column that will be written if
- * no padding is added. */
- int spacesToPad = desiredColumn - (string.length() + 1);
- spacesToPad = Math.max(spacesToPad, minimumPad);
- String modifiedString = string;
- while (spacesToPad > 0) {
- modifiedString = modifiedString + " ";
- spacesToPad--;
- }
- return modifiedString;
- }
-
- /**
* Formats the array index for java source code.
* @param index The index to be formatted.
* @return The formatted array index.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-05 15:05:31
|
Revision: 11884
http://sourceforge.net/p/foray/code/11884
Author: victormote
Date: 2021-02-05 15:05:28 +0000 (Fri, 05 Feb 2021)
Log Message:
-----------
Cleanup output processing a bit.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 14:43:48 UTC (rev 11883)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 15:05:28 UTC (rev 11884)
@@ -47,7 +47,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@@ -390,7 +391,7 @@
* written.
* @throws IOException For errors when writing to out.
*/
- public void writeAsJavaStatics(final OutputStream out) throws IOException {
+ public void writeAsJavaStatics(final Writer out) throws IOException {
if (out == null) {
return;
}
@@ -399,15 +400,17 @@
return;
}
+ final String eol = "\n";
+
// Comment out the first two arrays. They are for reference only.
- String s = "/*\n";
- out.write(s.getBytes());
+ out.write("/*");
+ out.write(eol);
// Write the glyph names.
- s = " public static final String[] sortedGlyphNames = {\n";
- out.write(s.getBytes());
+ out.write(" public static final String[] sortedGlyphNames = {");
+ out.write(eol);
for (int i = 0; i < this.glyphNames.size(); i++) {
- s = " \"";
+ String s = " \"";
s = s + this.glyphNames.get(i);
s = s + "\"";
if (i < this.glyphNames.size() - 1) {
@@ -421,20 +424,19 @@
EncodingParser.HEX_STRING_SIZE);
s = s + " \\" + StringUtils.charToOctalString(this.glyphIndexes.get(i),
EncodingParser.OCTAL_STRING_SIZE);
- s = s + "\n";
- out.write(s.getBytes());
+ out.write(s);
+ out.write(eol);
}
- s = " };\n";
- out.write(s.getBytes());
+ out.write(" };");
+ out.write(eol);
// Write the glyph name code points.
- s = "\n";
- out.write(s.getBytes());
- s = " public static final short[] glyphIndexes = {\n";
- out.write(s.getBytes());
+ out.write(eol);
+ out.write(" public static final short[] glyphIndexes = {");
+ out.write(eol);
for (int i = 0; i < this.glyphIndexes.size(); i++) {
final char index = this.glyphIndexes.get(i);
- s = " ";
+ String s = " ";
s = s + "0x";
s = s + StringUtils.charToHexString(index, true,
EncodingParser.HEX_STRING_SIZE);
@@ -449,23 +451,22 @@
s = padSpaces(s, EncodingParser.GLYPH_NAME_CODE_POINTS_COLUMN_3, 1);
s = s + this.glyphNames.get(i);
s = s + "\n";
- out.write(s.getBytes());
+ out.write(s);
}
- s = " };\n";
- out.write(s.getBytes());
+ out.write(" };");
+ out.write(eol);
// Close the comment for the first two arrays.
- s = "*/\n";
- out.write(s.getBytes());
+ out.write("*/");
+ out.write(eol);
// Write the code points.
- s = "\n";
- out.write(s.getBytes());
- s = " public static final char[] codePoints = {\n";
- out.write(s.getBytes());
+ out.write(eol);
+ out.write(" public static final char[] codePoints = {");
+ out.write(eol);
for (int i = 0; i < this.codePoints.length(); i++) {
final int index = this.codePoints.intAt(i);
- s = " ";
+ String s = " ";
s = s + "0x";
s = s + StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE);
if (i < this.codePoints.length() - 1) {
@@ -478,20 +479,18 @@
EncodingParser.HEX_STRING_SIZE);
s = s + " \\" + StringUtils.charToOctalString((char) this.codePointIndexes.intAt(i),
EncodingParser.HEX_STRING_SIZE);
- s = s + "\n";
- out.write(s.getBytes());
+ out.write(s);
+ out.write(eol);
}
- s = " };\n";
- out.write(s.getBytes());
+ out.write(" };");
+ out.write(eol);
// Write the code point indexes.
- s = "\n";
- out.write(s.getBytes());
- s = " public static final char[] codePointIndexes = {\n";
- out.write(s.getBytes());
+ out.write(eol);
+ out.write(" public static final char[] codePointIndexes = {\n");
for (int i = 0; i < this.codePointIndexes.length(); i++) {
final int index = this.codePointIndexes.intAt(i);
- s = " ";
+ String s = " ";
s = s + "0x";
s = s + StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE);
if (i < this.codePointIndexes.length() - 1) {
@@ -500,10 +499,13 @@
s = padSpaces(s, EncodingParser.CODE_POINTS_INDEX_1, 2);
s = s + "// " + formatArrayIndex(i);
s = s + "\n";
- out.write(s.getBytes());
+ out.write(s);
}
- s = " };\n";
- out.write(s.getBytes());
+ out.write(" };");
+ out.write(eol);
+
+ out.flush();
+ out.close();
}
/**
@@ -651,9 +653,9 @@
final int radix = Integer.parseInt(args[EncodingParser.ARG_RADIX]);
// Get the output stream.
- FileOutputStream output = null;
+ Writer output = null;
try {
- output = new FileOutputStream(args[EncodingParser.ARG_OUTPUT_URL]);
+ output = new OutputStreamWriter(new FileOutputStream(args[EncodingParser.ARG_OUTPUT_URL]));
} catch (final FileNotFoundException e2) {
logger.error("Unable to create FileOutputStream for: "
+ args[EncodingParser.ARG_OUTPUT_URL] + "\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-02-05 14:43:52
|
Revision: 11883
http://sourceforge.net/p/foray/code/11883
Author: victormote
Date: 2021-02-05 14:43:48 +0000 (Fri, 05 Feb 2021)
Log Message:
-----------
1. Sort code points and related indexes. 2. Fix command-line doc.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-01-29 19:11:51 UTC (rev 11882)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-02-05 14:43:48 UTC (rev 11883)
@@ -189,6 +189,7 @@
parseLines();
sortGlyphNames();
createCodePoints();
+ sortCodePoints();
}
/**
@@ -329,6 +330,25 @@
}
/**
+ * Parallel sorts the code points and code point indexes so that they can be efficiently searched.
+ */
+ private void sortCodePoints() {
+ boolean anyChanges = true;
+ while (anyChanges) {
+ anyChanges = false;
+ for (int i = 0; i < this.codePoints.length() - 1; i++) {
+ if (this.codePoints.intAt(i) > this.codePoints.intAt(i + 1)) {
+ /* They are out of order. Swap them. */
+ this.codePoints.swap(i, i + 1);
+ /* Also swap the same items in the code point indexes. */
+ this.codePointIndexes.swap(i, i + 1);
+ anyChanges = true;
+ }
+ }
+ }
+ }
+
+ /**
* For each glyph name in the encoding, finds all known Unicode code points
* that map to that glyph name, and writes them to an array. It also writes
* the glyph index for this encoding to a parallel array.
@@ -559,31 +579,28 @@
}
/**
- * Main method useful for parsing an encoding list file from the
- * command-line and generating the java code that encapsulates that
- * encoding.
- * @param args Element 0 is the URL of the encoding list to be parsed.
- * This file is a text file, one line per record, with at least two
- * whitespace-delimited fields.
- * The first field is always the glyph name.
- * The second and any other (optional) fields contain the glyph index for
- * that glyph name for a specific encoding.
- * Thus multiple encodings for the same glyph list can be contained in the
- * same file.
- * Element 1 is the column-number to parse.
- * Column number 1 is the first field after the glyph name, i.e. field 2.
- * Element 2 is the radix of the numbering system (10 for decimal, 8 for
- * octal, etc.).
- * Element 3 is the URL of the file to which the java source code should be
- * written.
- * Element 4 is the (optional) list of already-registered glyph lists that
- * should be consulted when searching for a glyph name.
- * The Adobe Glyph List is always consulted, but only after any custom ones
- * listed here.
+ * Command-line interface useful for parsing an encoding list file from the and generating the java code that
+ * encapsulates that encoding.
+ * @param args The command-line arguments.
+ * <ol>
+ * <li>Element 0: The URL of the encoding list to be parsed.
+ * This file is a text file, one line per record, with at least two whitespace-delimited fields.
+ * The first field is always the glyph name.
+ * The second and any other (optional) fields contain the glyph index for that glyph name for a specific
+ * encoding.
+ * Thus multiple encodings for the same glyph list can be contained in the same file.</li>
+ * <li>Element 1 is the column-number to parse.
+ * Column number 1 is the first field after the glyph name, i.e. field 2.</li>
+ * <li>Element 2 is the radix of the numbering system (10 for decimal, 8 for octal, etc.).</li>
+ * <li>Element 3 is the URL of the file to which the java source code should be written.</li>
+ * <li>Element 4 is the (optional) list of already-registered glyph lists that should be consulted when searching
+ * for a glyph name.
+ * The Adobe Glyph List is always consulted, but only after any custom ones listed here.
+ * </ol>
*/
public static void main(final String[] args) {
final Logger logger = LoggerFactory.getLogger(EncodingParser.class);
- final String usage = "Usage: GlyphListParser <input-file> "
+ final String usage = "Usage: " + EncodingParser.class.getName() + " <input-file> "
+ "<column-number> <output-file> <glyph-lists>?\n";
if (args.length > EncodingParser.MAX_ARGS
|| args.length < EncodingParser.MIN_ARGS) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 19:11:53
|
Revision: 11882
http://sourceforge.net/p/foray/code/11882
Author: victormote
Date: 2021-01-29 19:11:51 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Fix some font encoding-related problems.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-01-29 18:17:41 UTC (rev 11881)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-01-29 19:11:51 UTC (rev 11882)
@@ -274,6 +274,14 @@
private Encoding getBestEncoding(final int codePoint) {
Encoding trialEncoding = null;
final Encoding internalEncoding = this.font.getInternalEncoding();
+ if (internalEncoding.canEncode(codePoint)) {
+ return internalEncoding;
+ }
+
+
+
+
+
if (! (internalEncoding instanceof PsEncoding)) {
/* Cmap4a encodings should be able to handle any character in the
* font's character set. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-29 18:17:41 UTC (rev 11881)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-29 19:11:51 UTC (rev 11882)
@@ -143,13 +143,10 @@
final String encodingName = this.metricsFile.getEncoding();
PsEncoding encoding = null;
final PsServer psServer = this.getRegisteredFont().getFontServer().getPsServer();
- if (encodingName.equals("StandardEncoding")
- || encodingName.equals("AdobeStandardEncoding")) {
- encoding = psServer.getPredefinedEncoding(PsEncoding.Predefined.WIN_ANSI);
+ final PsEncoding.Predefined predefined = PsEncoding.Predefined.findByName(encodingName);
+ if (predefined != null) {
+ encoding = psServer.getPredefinedEncoding(predefined);
}
- if (getRegisteredFont().getConfiguredFontName().equals("Symbol")) {
- encoding = psServer.getPredefinedEncoding(PsEncoding.Predefined.SYMBOL);
- }
this.setInternalEncoding(encoding);
}
this.setCharSet(this.metricsFile.getCharSet());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 18:17:48
|
Revision: 11881
http://sourceforge.net/p/foray/code/11881
Author: victormote
Date: 2021-01-29 18:17:41 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Another attempt to get svn:keywords automated.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
Property Changed:
----------------
trunk/
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
Index: trunk
===================================================================
--- trunk 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk
___________________________________________________________________
Modified: svn:auto-props
## -1 +1 ##
-* svn:keywords=Author Date Id Rev
+* = svn:keywords=Author Date Id Rev
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11873 $
- * $LastChangedDate: 2021-01-28 10:32:18 -0700 (Thu, 28 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
package org.foray.common.data;
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11871 $
- * $LastChangedDate: 2021-01-28 07:52:03 -0700 (Thu, 28 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
package org.foray.common.data;
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11870 $
- * $LastChangedDate: 2021-01-27 16:21:31 -0700 (Wed, 27 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
package org.foray.common.primitive;
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11858 $
- * $LastChangedDate: 2021-01-24 14:21:20 -0700 (Sun, 24 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
/**
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 17:41:39
|
Revision: 11880
http://sourceforge.net/p/foray/code/11880
Author: victormote
Date: 2021-01-29 17:41:37 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Update Base-14 parsed metrics as they now have glyph bounding boxes included.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 17:16:49
|
Revision: 11879
http://sourceforge.net/p/foray/code/11879
Author: victormote
Date: 2021-01-29 17:16:47 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Fix bug in canEncode(int).
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 15:14:39 UTC (rev 11878)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 17:16:47 UTC (rev 11879)
@@ -414,7 +414,7 @@
@Override
public boolean canEncode(final int codePoint) {
- return this.encodeCharacter(codePoint) != 0;
+ return this.encodeCharacter(codePoint) > -1;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 15:14:42
|
Revision: 11878
http://sourceforge.net/p/foray/code/11878
Author: victormote
Date: 2021-01-29 15:14:39 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Add test of encoding vector.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
Added Paths:
-----------
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 14:36:16 UTC (rev 11877)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 15:14:39 UTC (rev 11878)
@@ -109,7 +109,14 @@
for (int index = 0; index < tempCodePoints.length(); index ++) {
final int codePoint = tempCodePoints.intAt(index);
+ if (codePoint < 0
+ || codePoint > Character.MAX_CODE_POINT) {
+ throw new IllegalArgumentException("Code point out out of range: " + codePoint);
+ }
final int codePointIndex = tempCodePointIndexes.intAt(index);
+ if (codePointIndex < 0) {
+ throw new IllegalArgumentException("Code point index out of range: " + codePointIndex);
+ }
if (codePoint > Character.MAX_VALUE) {
codePoints2Builder.append(codePoint);
codePointIndexes2Builder.append((char) codePointIndex);
@@ -132,6 +139,10 @@
@Override
public int encodeCharacter(final int codePoint) {
+ if (codePoint < 0) {
+ return -1;
+ }
+
int index = -1;
if (codePoint > Character.MAX_VALUE) {
index = this.codePoints2.binarySearch(codePoint);
Added: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java (rev 0)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java 2021-01-29 15:14:39 UTC (rev 11878)
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2021 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.foray.common.sequence.IntArray;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests of {@link EncodingVector4a}.
+ */
+public class EncodingVector4aTests {
+
+ /** A sequence of code points for testing. */
+ private static final IntArray CODE_POINTS_1 = new IntArray(14, Character.MAX_CODE_POINT, 0, 64_000, 28, 14_561);
+
+ /** A sequence of indexes for testing. */
+ private static final IntArray INDEXES_1 = new IntArray(0, 1, 2, 3, 4, 5);
+
+ @Test
+ public void negativeCodePointTest() {
+ final IntArray codePoints = new IntArray(14, 18, -1, 24, 15);
+ final IntArray indexes = new IntArray(0, 1, 2, 3, 4);
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void codePointTooHighTest() {
+ final IntArray codePoints = new IntArray(14, 18, Character.MAX_CODE_POINT + 1, 24, 15);
+ final IntArray indexes = new IntArray(0, 1, 2, 3, 4);
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void negativeIndexTest() {
+ final IntArray codePoints = new IntArray(14, 18, 1, 24, 15);
+ final IntArray indexes = new IntArray(0, 1, -2, 3, 4);
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void quantityMismatchTest() {
+ final IntArray codePoints = new IntArray(14, 18, 1, 24, 15); // 5 elements.
+ final IntArray indexes = new IntArray(0, 1, -2, 3); // 4 elements.
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void encodingTest01() {
+ final EncodingVector4a out = new EncodingCustom("Test Encoding", null, CODE_POINTS_1, INDEXES_1);
+
+ /* Test the ones that are in the encoding. */
+ Assert.assertEquals(5, out.encodeCharacter(14_561));
+ Assert.assertEquals(4, out.encodeCharacter(28));
+ Assert.assertEquals(3, out.encodeCharacter(64_000));
+ Assert.assertEquals(2, out.encodeCharacter(0));
+ Assert.assertEquals(1, out.encodeCharacter(Character.MAX_CODE_POINT));
+ Assert.assertEquals(0, out.encodeCharacter(14));
+
+ /* Now test some that aren't. */
+ Assert.assertEquals(-1, out.encodeCharacter(Integer.MIN_VALUE));
+ Assert.assertEquals(-1, out.encodeCharacter(-200));
+ Assert.assertEquals(-1, out.encodeCharacter(-1));
+ Assert.assertEquals(-1, out.encodeCharacter(1));
+ Assert.assertEquals(-1, out.encodeCharacter(200));
+ Assert.assertEquals(-1, out.encodeCharacter(Integer.MAX_VALUE));
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 14:36:19
|
Revision: 11877
http://sourceforge.net/p/foray/code/11877
Author: victormote
Date: 2021-01-29 14:36:16 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Make the codepoint indexes an int sequence instead of char, to handle future changes, and to avoid confusion.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -30,7 +30,6 @@
import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.io.RandomAccessInput;
-import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
@@ -532,7 +531,7 @@
* Array parallel to {@link #internalCodePoints} and containing the
* encoded indexes that correspond to the elements therein.
*/
- private transient CharArrayBuilder internalCodePointIndexes;
+ private transient IntArrayBuilder internalCodePointIndexes;
/** The number of internalCodePoint elements parsed so far. */
private transient int internalCodePointCount = 0;
@@ -1048,7 +1047,7 @@
this.metrics.setGlyphBoundingBoxes(glyphBoundingBoxes);
// 256 is the maximum size needed. The actual encoding may be less.
this.internalCodePoints = new IntArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
- this.internalCodePointIndexes = new CharArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
+ this.internalCodePointIndexes = new IntArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -247,7 +247,7 @@
@Override
public PsEncoding makeEncodingVector(final String name, final IntSequence codePoints,
- final CharSequence codePointIndexes) {
+ final IntSequence codePointIndexes) {
return new EncodingCustom(name, null, codePoints, codePointIndexes);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -279,7 +278,7 @@
super(Encoding4aLatinExtra.NAME,
GlyphList4a.standardSourceGlyphLists(),
new IntArray(Encoding4aLatinExtra.CODE_POINTS),
- new CharArray(Encoding4aLatinExtra.CODE_POINT_INDEXES));
+ new IntArray(Encoding4aLatinExtra.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -948,7 +947,7 @@
super(PsEncoding.Predefined.CE.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingCe.CODE_POINTS),
- new CharArray(EncodingCe.CODE_POINT_INDEXES));
+ new IntArray(EncodingCe.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -57,7 +57,7 @@
* {@code codePoints[n]}.
*/
public EncodingCustom(final String name, final List<GlyphList> sourceGlyphLists, final IntSequence codePoints,
- final CharSequence codePointIndexes) {
+ final IntSequence codePointIndexes) {
super(name, sourceGlyphLists, codePoints, codePointIndexes);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -747,7 +746,7 @@
super(PsEncoding.Predefined.EXPERT.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingExpert.CODE_POINTS),
- new CharArray(EncodingExpert.CODE_POINT_INDEXES));
+ new IntArray(EncodingExpert.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -432,7 +431,7 @@
super(PsEncoding.Predefined.EXPERT_SUBSET.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingExpertSubset.CODE_POINTS),
- new CharArray(EncodingExpertSubset.CODE_POINT_INDEXES));
+ new IntArray(EncodingExpertSubset.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -887,7 +886,7 @@
super(PsEncoding.Predefined.ISO_LATIN_1.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingIsoLatin1.CODE_POINTS),
- new CharArray(EncodingIsoLatin1.CODE_POINT_INDEXES));
+ new IntArray(EncodingIsoLatin1.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -747,7 +746,7 @@
super(PsEncoding.Predefined.MAC_EXPERT.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingMacExpert.CODE_POINTS),
- new CharArray(EncodingMacExpert.CODE_POINT_INDEXES));
+ new IntArray(EncodingMacExpert.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -915,7 +914,7 @@
super(PsEncoding.Predefined.MAC_ROMAN.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingMacRoman.CODE_POINTS),
- new CharArray(EncodingMacRoman.CODE_POINT_INDEXES));
+ new IntArray(EncodingMacRoman.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -1126,7 +1125,7 @@
super(PsEncoding.Predefined.STANDARD_MACINTOSH_ORDERING.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingMacStandard.CODE_POINTS),
- new CharArray(EncodingMacStandard.CODE_POINT_INDEXES));
+ new IntArray(EncodingMacStandard.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -31,11 +31,9 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharacterUtils;
import org.foray.common.primitive.StringUtils;
-import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.common.url.UrlFactory;
-import org.axsl.common.sequence.CharSequenceMutable;
import org.axsl.common.sequence.IntSequenceMutable;
import org.axsl.ps.GlyphList;
import org.axsl.ps.PsException;
@@ -157,7 +155,7 @@
private IntArrayBuilder codePoints = new IntArrayBuilder();
/** The parsed encoded indexes. */
- private CharArrayBuilder codePointIndexes = new CharArrayBuilder();
+ private IntArrayBuilder codePointIndexes = new IntArrayBuilder();
/**
* Create a new EncodingParser instance.
@@ -353,11 +351,11 @@
if (codePoint != Character.MAX_VALUE) {
this.codePoints.setIntAt(i, codePoint);
final char glyphIndex = this.glyphIndexes.get(i);
- this.codePointIndexes.setCharAt(i, glyphIndex);
+ this.codePointIndexes.setIntAt(i, glyphIndex);
break;
}
}
- if (this.codePointIndexes.charAt(i) == 0
+ if (this.codePointIndexes.intAt(i) == 0
&& ! glyphName.equals(EncodingVector4a.NOTDEF)) {
throw new PsException("Glyph name not found: " + glyphName);
}
@@ -456,9 +454,9 @@
s = padSpaces(s, EncodingParser.CODE_POINTS_COLUMN_1, 2);
s = s + "// " + formatArrayIndex(i);
s = padSpaces(s, EncodingParser.CODE_POINTS_COLUMN_2, 2);
- s = s + " glyph: 0x" + StringUtils.charToHexString(this.codePointIndexes.charAt(i), true,
+ s = s + " glyph: 0x" + StringUtils.charToHexString((char) this.codePointIndexes.intAt(i), true,
EncodingParser.HEX_STRING_SIZE);
- s = s + " \\" + StringUtils.charToOctalString(this.codePointIndexes.charAt(i),
+ s = s + " \\" + StringUtils.charToOctalString((char) this.codePointIndexes.intAt(i),
EncodingParser.HEX_STRING_SIZE);
s = s + "\n";
out.write(s.getBytes());
@@ -472,7 +470,7 @@
s = " public static final char[] codePointIndexes = {\n";
out.write(s.getBytes());
for (int i = 0; i < this.codePointIndexes.length(); i++) {
- final char index = this.codePointIndexes.charAt(i);
+ final int index = this.codePointIndexes.intAt(i);
s = " ";
s = s + "0x";
s = s + StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE);
@@ -523,7 +521,7 @@
* Returns the codepoint indexes.
* @return The codepoint indexes.
*/
- public CharSequenceMutable getCodePointIndexes() {
+ public IntSequenceMutable getCodePointIndexes() {
return this.codePointIndexes;
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -1003,7 +1002,7 @@
super(PsEncoding.Predefined.PDF_DOC.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingPdfDoc.CODE_POINTS),
- new CharArray(EncodingPdfDoc.CODE_POINT_INDEXES));
+ new IntArray(EncodingPdfDoc.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -686,7 +685,7 @@
super(PsEncoding.Predefined.STANDARD.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingStandard.CODE_POINTS),
- new CharArray(EncodingStandard.CODE_POINT_INDEXES));
+ new IntArray(EncodingStandard.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -851,7 +850,7 @@
super(PsEncoding.Predefined.SYMBOL.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingSymbol.CODE_POINTS),
- new CharArray(EncodingSymbol.CODE_POINT_INDEXES));
+ new IntArray(EncodingSymbol.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -33,7 +33,6 @@
import org.foray.common.sequence.IntArray;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.common.sequence.CharSequenceMutable;
import org.axsl.common.sequence.IntSequence;
import org.axsl.common.sequence.IntSequenceMutable;
import org.axsl.ps.Encoding;
@@ -89,13 +88,13 @@
* {@code codePoints[n]}.
*/
public EncodingVector4a(final String name, final List<GlyphList> sourceGlyphLists, final IntSequence codePoints,
- final CharSequence codePointIndexes) {
+ final IntSequence codePointIndexes) {
this.name = name;
this.sourceGlyphLists = sourceGlyphLists;
/* Get mutable instances. */
final IntSequenceMutable tempCodePoints = IntArrayBuilder.fromIntSequence(codePoints);
- final CharSequenceMutable tempCodePointIndexes = CharArrayBuilder.fromCharSequence(codePointIndexes);
+ final IntSequenceMutable tempCodePointIndexes = IntArrayBuilder.fromIntSequence(codePointIndexes);
if (tempCodePoints.length() != tempCodePointIndexes.length()) {
throw new IllegalArgumentException("codePoints and codePointIndexes must be of the same length.");
@@ -110,20 +109,20 @@
for (int index = 0; index < tempCodePoints.length(); index ++) {
final int codePoint = tempCodePoints.intAt(index);
- final char codePointIndex = tempCodePointIndexes.charAt(index);
+ final int codePointIndex = tempCodePointIndexes.intAt(index);
if (codePoint > Character.MAX_VALUE) {
codePoints2Builder.append(codePoint);
- codePointIndexes2Builder.append(codePointIndex);
+ codePointIndexes2Builder.append((char) codePointIndex);
} else {
codePointsBuilder.append((char) codePoint);
- codePointIndexesBuilder.append(codePointIndex);
+ codePointIndexesBuilder.append((char) codePointIndex);
}
}
- this.codePoints = new CharArray(codePointsBuilder);
- this.codePointIndexes = new CharArray(codePointIndexesBuilder);
- this.codePoints2 = new IntArray(codePoints2Builder);
- this.codePointIndexes2 = new CharArray(codePointIndexes2Builder);
+ this.codePoints = codePointsBuilder.toCharArray();
+ this.codePointIndexes = codePointIndexesBuilder.toCharArray();
+ this.codePoints2 = codePoints2Builder.toIntArray();
+ this.codePointIndexes2 = codePointIndexes2Builder.toCharArray();
}
@Override
@@ -236,7 +235,7 @@
* @param codePoints The array of Unicode code points to be sorted.
* @param codePointIndexes The array of encoding indexes that whose elements correspond to elements in codePoints.
*/
- public void sortCodePoints(final IntSequenceMutable codePoints, final CharSequenceMutable codePointIndexes) {
+ public void sortCodePoints(final IntSequenceMutable codePoints, final IntSequenceMutable codePointIndexes) {
boolean anyChanges = true;
while (anyChanges) {
anyChanges = false;
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -951,7 +950,7 @@
super(PsEncoding.Predefined.WIN_ANSI.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingWinAnsi.CODE_POINTS),
- new CharArray(EncodingWinAnsi.CODE_POINT_INDEXES));
+ new IntArray(EncodingWinAnsi.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.GlyphList;
@@ -914,7 +913,7 @@
super(PsEncoding.Predefined.ZAPF_DINGBATS.getName(),
EncodingZapfDingbats.GLYPH_LISTS_USED,
new IntArray(EncodingZapfDingbats.CODE_POINTS),
- new CharArray(EncodingZapfDingbats.CODE_POINT_INDEXES));
+ new IntArray(EncodingZapfDingbats.CODE_POINT_INDEXES));
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 12:17:27
|
Revision: 11876
http://sourceforge.net/p/foray/code/11876
Author: victormote
Date: 2021-01-29 12:17:24 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
1. Conform to aXSL change: Add method to return the bounding box for a single glyph. 2. Rewrite TrueTypeFont.convertFunitsToMillipoints & add a test.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
Added Paths:
-----------
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -73,7 +73,7 @@
* @param bBox The bounding box whose width should be computed.
* @return The width of the bounding box.
*/
- public static float computeWidthAsInt(final BoundingBox bBox) {
+ public static int computeWidthAsInt(final BoundingBox bBox) {
final int urx = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_X_INDEX);
final int llx = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_X_INDEX);
return urx - llx;
@@ -84,7 +84,7 @@
* @param bBox The bounding box whose width should be computed.
* @return The width of the bounding box.
*/
- public static float computeHeightAsInt(final BoundingBox bBox) {
+ public static int computeHeightAsInt(final BoundingBox bBox) {
final int ury = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_Y_INDEX);
final int lly = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_Y_INDEX);
return ury - lly;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -440,10 +440,10 @@
/**
* Set the widths for this font.
- * @param width The width array to set.
+ * @param widths The width array to set.
*/
- protected void setWidths(final short[] width) {
- this.width = width;
+ protected void setWidths(final short[] widths) {
+ this.width = widths;
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -30,6 +30,7 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxShort;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
@@ -263,4 +264,14 @@
return this.getInternalEncoding().encodeCharacter(codePoint);
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ final BoundingBox raw = this.ttf.getHmtxTable().getMtxEntry(glyphIndex).getBoundingBox();
+ final short[] scaled = new short[BoundingBox.QTY_ENTRIES];
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ scaled[index] = this.ttf.convertFunitsToMillipoints(raw.getCoordinateAsInt(index));
+ }
+ return new BoundingBoxShort(scaled);
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -29,6 +29,7 @@
package org.foray.font;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.FontParser;
import org.foray.font.format.type1.Type1Font;
@@ -413,4 +414,17 @@
return metricIndex;
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ final BoundingBox raw = this.metricsFile.getGlyphBoundingBoxes()[glyphIndex];
+ if (fontSize == WellKnownConstants.MILLIPOINTS_PER_POINT) {
+ return raw;
+ }
+ final float[] scaled = new float[BoundingBox.QTY_ENTRIES];
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ scaled[index] = raw.getCoordinateAsFloat(index) * fontSize / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ }
+ return BoundingBoxUtils.makeBoundingBox(scaled);
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -30,6 +30,7 @@
import org.foray.common.Environment;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.FontParser;
import org.foray.font.format.Kerning;
@@ -573,4 +574,10 @@
return 0;
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ /* TODO: Not sure what to do here. */
+ return BoundingBoxUtils.ZEROES;
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -50,7 +50,7 @@
* The TrueType spec can be found at the Microsoft
* Typography site: http://www.microsoft.com/truetype/
*/
-public final class TrueTypeFont {
+public class TrueTypeFont {
/** The parent offset table. */
private TtfOffsetTable ttfTableDir = null;
@@ -135,7 +135,7 @@
* Note: To get an instance of TTFFont, use {@link TrueTypeFont#makeTTFFont(TtfOffsetTable)}.
* @param ttfTableDir The table directory from which this font should be created.
*/
- private TrueTypeFont(final TtfOffsetTable ttfTableDir) {
+ TrueTypeFont(final TtfOffsetTable ttfTableDir) {
this.ttfTableDir = ttfTableDir;
}
@@ -298,6 +298,14 @@
}
/**
+ * Package-visible setter, intended for testing.
+ * @param headTable The headTable value to set.
+ */
+ void setHeadTable(final TtfTableHead headTable) {
+ this.headTable = headTable;
+ }
+
+ /**
* Returns the "head" table.
* @return The "head" table.
*/
@@ -503,28 +511,38 @@
}
/**
- * Converts from a TrueType text space unit value to millipoints, based on
- * the "unitsPerEm" field in the "head" table.
- * @param ttfUnit The TrueType text space unit value to be converted.
- * @return The equivalent millipoint value.
+ * Converts a TrueType Funits value to millipoints, based on the "unitsPerEm" field in the "head" table.
+ * Note that no consideration of font size is used here: the returned value is scaled to 1 point.
+ * Multiply the returned value by the font size, in points, to get the number of millipoints scaled to that size.
+ * @param fUnits The TrueType FUnit value to be converted to millipoints.
+ * @return The size, in millipoints, of {@code fUnits} when the font size is 1 point.
+ * @see "https://docs.microsoft.com/en-us/typography/opentype/spec/ttch01#digitizing-a-design"
*/
- short getTTFFunit(final int ttfUnit) {
- final int ret;
- if (ttfUnit < 0) {
- final long rest1 = ttfUnit % this.headTable.unitsPerEm();
- final long storrest = 1000 * rest1;
- final long ledd2 = rest1 / storrest;
- ret = -((-WellKnownConstants.MILLIPOINTS_PER_POINT * ttfUnit)
- / this.headTable.unitsPerEm() - (int) ledd2);
- } else {
- ret = (ttfUnit / this.headTable.unitsPerEm())
- * WellKnownConstants.MILLIPOINTS_PER_POINT
- + ((ttfUnit % this.headTable.unitsPerEm())
- * WellKnownConstants.MILLIPOINTS_PER_POINT)
- / this.headTable.unitsPerEm();
+ public short convertFunitsToMillipoints(final int fUnits) {
+ /* Per the TrueType documentation, the conversion scale is:
+ * pointSize * resolution / ( 72 points per inch * units_per_em )
+ * We are explicitly factoring out the consideration of point size in this method, effectively making the point
+ * size 1. So we are left with:
+ * resolution / ( 72 points per inch * units_per_em )
+ * Since the resolution of the text space that we are computing for is also 72 points per inch, the resolution
+ * in the numerator and that in the denominator cancel each other. We are left then with:
+ * / units_per_em
+ * which makes intuitive sense.
+ */
+
+ /* Use the getter here to facilitate testing with a mock object. */
+ final TtfTableHead headTable = this.getHeadTable();
+ final int unitsPerEm = headTable.unitsPerEm();
+
+ final double result = ((float) fUnits) * WellKnownConstants.MILLIPOINTS_PER_POINT / unitsPerEm;
+ final long roundedResult = Math.round(result);
+ /* This cast from a long to a short looks horrible, but should be safe. The results should almost always be in
+ * the range +/- 1500. Log an error if there is any truncation. */
+ if (roundedResult < Short.MIN_VALUE
+ || roundedResult > Short.MAX_VALUE) {
+ getLogger().error("Glyph space metric outside range of a \"short\", actual: " + roundedResult);
}
-
- return (short) ret;
+ return (short) roundedResult;
}
/**
@@ -651,7 +669,7 @@
* @return The lowercase ascent value for this font.
*/
public int getLowerCaseAscent() {
- return getTTFFunit(getAscender());
+ return convertFunitsToMillipoints(getAscender());
}
/**
@@ -659,7 +677,7 @@
* @return The lowercase descent value for this font.
*/
public int getLowerCaseDescent() {
- return getTTFFunit(getDescender());
+ return convertFunitsToMillipoints(getDescender());
}
/**
@@ -669,7 +687,7 @@
public short[] getWidths() {
final short[] wx = new short[this.hmtxTable.numMtxEntries()];
for (int i = 0; i < wx.length; i++) {
- wx[i] = getTTFFunit(this.hmtxTable.getMtxEntry(i).getWidth());
+ wx[i] = convertFunitsToMillipoints(this.hmtxTable.getMtxEntry(i).getWidth());
}
return wx;
}
@@ -789,7 +807,7 @@
*/
public int strikeoutSize() {
final int dsStrikeoutSize = this.os2Table.getStrikeoutSize();
- final int mpStrikeoutSize = this.getTTFFunit(dsStrikeoutSize);
+ final int mpStrikeoutSize = this.convertFunitsToMillipoints(dsStrikeoutSize);
return mpStrikeoutSize;
}
@@ -799,7 +817,7 @@
*/
public int strikeoutPosition() {
final int dsStrikeoutPosition = this.os2Table.getStrikeoutPosition();
- final int mpStrikeoutPosition = this.getTTFFunit(dsStrikeoutPosition);
+ final int mpStrikeoutPosition = this.convertFunitsToMillipoints(dsStrikeoutPosition);
return mpStrikeoutPosition;
}
@@ -809,7 +827,7 @@
*/
public int underlineSize() {
final int dsUnderlineSize = this.postTable.getUnderlineThickness();
- final int mpUnderlineSize = this.getTTFFunit(dsUnderlineSize);
+ final int mpUnderlineSize = this.convertFunitsToMillipoints(dsUnderlineSize);
return mpUnderlineSize;
}
@@ -819,7 +837,7 @@
*/
public int underlinePosition() {
final int dsUnderlinePosition = this.postTable.getUnderlinePosition();
- final int mpUnderlinePosition = this.getTTFFunit(dsUnderlinePosition);
+ final int mpUnderlinePosition = this.convertFunitsToMillipoints(dsUnderlinePosition);
return mpUnderlinePosition;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -28,12 +28,14 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxUtils;
+
import org.axsl.common.data.BoundingBox;
/**
* A TTF Font Mtx entry.
*/
-class TtfMtxEntry {
+public class TtfMtxEntry {
/** The glyph width. */
private int wx;
@@ -42,7 +44,7 @@
private int lsb;
/** The glyph bounding box. */
- private int[] bbox = new int[BoundingBox.QTY_ENTRIES];
+ private BoundingBox bbox;
/** Obtained from the "loca" table. */
private long offset;
@@ -61,8 +63,7 @@
if (this.bbox == null) {
return 0;
}
- return this.bbox[BoundingBox.UPPER_RIGHT_Y_INDEX]
- - this.bbox[BoundingBox.LOWER_LEFT_Y_INDEX];
+ return BoundingBoxUtils.computeHeightAsInt(this.bbox);
}
/**
@@ -114,29 +115,19 @@
}
/**
- * Returns a specific bbox value for this entry.
- * @param index The index into the bbox array that is sought.
- * @return The bbox value for {@code index}.
+ * Returns the bounding box for this entry.
+ * @return The bounding box.
*/
- public int getBBoxValue(final int index) {
- if (index < 0
- || index > BoundingBox.QTY_ENTRIES - 1) {
- return Integer.MIN_VALUE;
- }
- return this.bbox[index];
+ public BoundingBox getBoundingBox() {
+ return this.bbox;
}
/**
- * Sets a specific bbox value for this entry.
- * @param index The index into the bbox array that should be set.
- * @param value The new bbox value that should be set.
+ * Sets the bounding box for this entry.
+ * @param boundingBox The new bounding box.
*/
- public void setBBoxValue(final int index, final int value) {
- if (index < 0
- || index > BoundingBox.QTY_ENTRIES - 1) {
- return;
- }
- this.bbox[index] = value;
+ public void setBoundingBox(final BoundingBox boundingBox) {
+ this.bbox = boundingBox;
}
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -28,6 +28,7 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxShort;
import org.foray.common.io.RandomAccessInput;
import org.foray.common.primitive.BitUtils;
@@ -102,15 +103,13 @@
raInput.seek(dirEntry.getOffset()
+ thisMetric.getOffset());
raInput.skipBytes(2);
+ final short[] bboxEntries = new short[BoundingBox.QTY_ENTRIES];
for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = raInput.readShort();
- thisMetric.setBBoxValue(j, bboxValue);
+ bboxEntries[j] = raInput.readShort();
}
+ thisMetric.setBoundingBox(new BoundingBoxShort(bboxEntries));
} else {
- for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = firstMetric.getBBoxValue(j);
- thisMetric.setBBoxValue(j, bboxValue);
- }
+ thisMetric.setBoundingBox(firstMetric.getBoundingBox());
}
}
@@ -122,15 +121,13 @@
|| thisMetric.getOffset() != nextMetric.getOffset()) {
raInput.seek(n + thisMetric.getOffset());
raInput.skipBytes(2);
+ final short[] bboxEntries = new short[BoundingBox.QTY_ENTRIES];
for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = raInput.readShort();
- thisMetric.setBBoxValue(j, bboxValue);
+ bboxEntries[j] = raInput.readShort();
}
+ thisMetric.setBoundingBox(new BoundingBoxShort(bboxEntries));
} else {
- for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = firstMetric.getBBoxValue(0);
- thisMetric.setBBoxValue(j, bboxValue);
- }
+ thisMetric.setBoundingBox(firstMetric.getBoundingBox());
}
}
return glyf;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -158,6 +158,9 @@
/** The parsed extent table. */
private short[] extentTable;
+ /** The parsed bounding boxes. */
+ private BoundingBox[] glyphBoundingBoxes;
+
/** The parsed kerning table. */
private Kerning kerning;
@@ -669,6 +672,22 @@
}
/**
+ * Sets the glyph bounding boxes.
+ * @param glyphBoundingBoxes The new glyph bounding boxes.
+ */
+ public void setGlyphBoundingBoxes(final BoundingBox[] glyphBoundingBoxes) {
+ this.glyphBoundingBoxes = glyphBoundingBoxes;
+ }
+
+ /**
+ * Returns the glyph bounding boxes.
+ * @return The glyph bounding boxes.
+ */
+ public BoundingBox[] getGlyphBoundingBoxes() {
+ return this.glyphBoundingBoxes;
+ }
+
+ /**
* Sets the underline thickness.
* @param underlineThickness The underlineThickness to set.
*/
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -509,6 +509,9 @@
/** The glyph width parsed from the "WX" token. */
private transient short charWidth = Short.MIN_VALUE;
+ /** The bounding box parsed from the "B" token. */
+ private transient BoundingBox glyphBoundingBox = BoundingBoxUtils.ZEROES;
+
/** If we need to build a CharSet for this font, this array is where the
* characters are accumulated, then later sorted, and eventually is used
* to create the CharSet instance. */
@@ -1041,6 +1044,8 @@
}
final short[] extentTable = new short[this.qtyCharMetricsExpected];
this.metrics.setExtentTable(extentTable);
+ final BoundingBox[] glyphBoundingBoxes = new BoundingBox [this.qtyCharMetricsExpected];
+ this.metrics.setGlyphBoundingBoxes(glyphBoundingBoxes);
// 256 is the maximum size needed. The actual encoding may be less.
this.internalCodePoints = new IntArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
this.internalCodePointIndexes = new CharArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
@@ -1207,10 +1212,11 @@
* Process a "B" keyword.
*/
private void b() {
- /* Ignore bounding box for now. */
+ final float[] entries = new float[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
- burnToken();
+ entries[i] = getFloat();
}
+ this.glyphBoundingBox = BoundingBoxUtils.makeBoundingBox(entries);
}
/**
@@ -1395,16 +1401,6 @@
}
/**
- * "Burns" the current token by ignoring it and advaning to the next one.
- */
- private void burnToken() {
- if (! this.currentTokenizer.hasMoreTokens()) {
- return;
- }
- this.currentTokenizer.nextToken();
- }
-
- /**
* Indicates whether the current key makes sense with the current context.
* @return True if the context matches the current key.
*/
@@ -1470,6 +1466,7 @@
+ this.currentLineNumber);
}
extentTable[charIndex] = this.charWidth;
+ this.metrics.getGlyphBoundingBoxes()[charIndex] = this.glyphBoundingBox;
if (this.glyphIndex > -1) {
/* Accumulate the information needed to create the internal
* Encoding. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -271,4 +271,10 @@
return 0;
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Added: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java (rev 0)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2021 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.font.format.ttf;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+/**
+ * Tests of {@link TrueTypeFont}.
+ */
+public class TrueTypeFontTests {
+
+ /**
+ * Test of {@link TrueTypeFont#convertFunitsToMillipoints(int)}.
+ * This test loosely based on example given in the Microsoft TrueType documention.
+ * @see "https://docs.microsoft.com/en-us/typography/opentype/spec/ttch01#scaling-a-glyph"
+ */
+ @Test
+ public void convertFunitsToMillipointsTest01() {
+
+ /* From the documentation: "For example, assume that a glyph feature is 550 FUnits in length on a 72 dpi screen
+ * at 18 point. There are 2048 units per em. The following calculation reveals that the feature is 4.83 pixels
+ * long." We are not converting to pixels, but to a more abstract calculation of millipoints. Nevertheless, we
+ * will use this example in this test. */
+
+ final TtfTableHead headTable = Mockito.mock(TtfTableHead.class);
+ Mockito.when(headTable.unitsPerEm()).thenReturn(2048);
+
+ final TrueTypeFont out = new TrueTypeFont(null);
+ out.setHeadTable(headTable);
+
+ short actual = out.convertFunitsToMillipoints(550);
+ /* 550 * 1000 / 2048 = 268.5546875. */
+ Assert.assertEquals(269, actual);
+
+ /* Check the same value as a negative. */
+ actual = out.convertFunitsToMillipoints(-550);
+ Assert.assertEquals(-269, actual);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 21:12:33
|
Revision: 11875
http://sourceforge.net/p/foray/code/11875
Author: victormote
Date: 2021-01-28 21:12:30 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Change some array return values to sequences.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-01-28 18:58:50 UTC (rev 11874)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-01-28 21:12:30 UTC (rev 11875)
@@ -270,31 +270,18 @@
}
@Override
- public int[] unavailableChars(final CharSequence charSequence,
- final int beginIndex) {
- int count = 0;
- /* Count them first. */
+ public IntSequence unavailableChars(final CharSequence charSequence, final int beginIndex) {
+ IntArrayBuilder builder = null;
for (int i = 0; i < charSequence.length(); i++) {
final char c = charSequence.charAt(i);
if (! glyphAvailable(c)) {
- count++;
+ if (builder == null) {
+ builder = new IntArrayBuilder();
+ }
+ builder.append(i);
}
}
- if (count < 1) {
- return null;
- }
- /* Create empty array. */
- final int[] returnArray = new int[count];
- /* Read through them again, completing the array. */
- count = 0;
- for (int i = 0; i < charSequence.length(); i++) {
- final char c = charSequence.charAt(i);
- if (! glyphAvailable(c)) {
- returnArray[count] = i;
- count++;
- }
- }
- return returnArray;
+ return builder;
}
@Override
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java 2021-01-28 18:58:50 UTC (rev 11874)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java 2021-01-28 21:12:30 UTC (rev 11875)
@@ -37,6 +37,7 @@
import org.axsl.common.para.ParaConfig;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaNode;
+import org.axsl.common.sequence.ByteSequence;
import org.axsl.hyphen.Word;
import org.axsl.hyphen.WordSegment;
@@ -166,7 +167,7 @@
}
@Override
- public int[] getHeinousPoints() {
+ public ByteSequence getHeinousPoints() {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 18:58:54
|
Revision: 11874
http://sourceforge.net/p/foray/code/11874
Author: victormote
Date: 2021-01-28 18:58:50 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
1. Add BoundingBox implementation that uses short. Add factory method that picks the most compact BoundingBox implementation.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -39,9 +39,6 @@
*/
public class BoundingBoxFloat implements BoundingBox, Serializable {
- /** An bounding box whose values are all zero, useful for initializing. */
- public static final BoundingBoxFloat ZEROES = new BoundingBoxFloat(0, 0, 0, 0);
-
/** Constant needed for serialization. */
private static final long serialVersionUID = 1176678668590516253L;
Added: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2006 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision: 11873 $
+ * $LastChangedDate: 2021-01-28 10:32:18 -0700 (Thu, 28 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.common.data;
+
+import org.axsl.common.data.BoundingBox;
+
+import java.io.Serializable;
+
+/**
+ * <p>A bounding box, as commonly used in graphical applications.</p>
+ *
+ * <p>Instances of this class are immutable.</p>
+ */
+public class BoundingBoxShort implements BoundingBox, Serializable {
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = -1721304270800103728L;
+
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+
+ /** The lower-left X value. */
+ private short llx;
+
+ /** The lower-left Y value. */
+ private short lly;
+
+ /** The upper-right X value. */
+ private short urx;
+
+ /** The upper-right Y value. */
+ private short ury;
+
+ /**
+ * Constructor.
+ * @param lowerLeftX The lower-left X coordinate for the bounding box.
+ * @param lowerLeftY The lower-left Y coordinate for the bounding box.
+ * @param upperRightX The upper-right X coordinate for the bounding box.
+ * @param upperRightY The upper-right Y coordinate for the bounding box.
+ */
+ public BoundingBoxShort(final int lowerLeftX, final int lowerLeftY, final int upperRightX, final int upperRightY) {
+ this.llx = (short) lowerLeftX;
+ this.lly = (short) lowerLeftY;
+ this.urx = (short) upperRightX;
+ this.ury = (short) upperRightY;
+ }
+
+ /**
+ * Constructor for a pre-existing array.
+ * @param array The array containing the bounds.
+ * This array must have exactly four elements.
+ */
+ public BoundingBoxShort(final short[] array) {
+ if (array.length != BoundingBox.QTY_ENTRIES) {
+ throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
+ }
+ this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
+ this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
+ this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
+ this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
+ }
+
+ @Override
+ public float getCoordinateAsFloat(final int index) {
+ return getCoordinateAsShort(index);
+ }
+
+ @Override
+ public int getCoordinateAsInt(final int index) {
+ return getCoordinateAsShort(index);
+ }
+
+ @Override
+ public short getCoordinateAsShort(final int index) {
+ switch(index) {
+ case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
+ case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
+ case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
+ case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
+ }
+ throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
+ }
+
+ @Override
+ public Class<? extends Number> getNativeType() {
+ return Short.TYPE;
+ }
+
+}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,6 +28,8 @@
package org.foray.common.data;
+import org.foray.common.primitive.FloatUtils;
+
import org.axsl.common.data.BoundingBox;
/**
@@ -35,6 +37,9 @@
*/
public final class BoundingBoxUtils {
+ /** An bounding box whose values are all zero, useful for initializing. */
+ public static final BoundingBoxShort ZEROES = new BoundingBoxShort((short) 0, (short) 0, (short) 0, (short) 0);
+
/**
* Private constructor.
* This is a utility class, and should never be instantiated.
@@ -115,4 +120,55 @@
return true;
}
+ /**
+ * Factory method that creates an instance of the best {@link BoundingBox} implementation for a given set of
+ * coordinates.
+ * This is useful in cases where the expected values may not conform to a set of criteria needed for a specific
+ * implementation.
+ * @param array The array containing the coordinates.
+ * @return A {@link BoundingBox} instance that stores the coordinates most efficiently.
+ */
+ public static BoundingBox makeBoundingBox(final float[] array) {
+ /* Our most compact implementation is {@link BoundingBoxShort}, so we attempt that first. */
+ boolean isShortOk = true;
+ final short[] shorts = new short[BoundingBox.QTY_ENTRIES];
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final float value = array[index];
+ if (FloatUtils.isShort(value)) {
+ shorts[index] = (short) value;
+ } else {
+ isShortOk = false;
+ break;
+ }
+ }
+
+ if (isShortOk) {
+ return new BoundingBoxShort(shorts);
+ }
+
+ /* Use the default/fallback implementation. */
+ return new BoundingBoxFloat(array);
+ }
+
+ /**
+ * Factory method that creates an instance of the best {@link BoundingBox} implementation for a given set of
+ * coordinates.
+ * This is useful in cases where the expected values may not conform to a set of criteria needed for a specific
+ * implementation.
+ * @param lowerLeftX The lower-left X coordinate for the bounding box.
+ * @param lowerLeftY The lower-left Y coordinate for the bounding box.
+ * @param upperRightX The upper-right X coordinate for the bounding box.
+ * @param upperRightY The upper-right Y coordinate for the bounding box.
+ * @return A {@link BoundingBox} instance that stores the coordinates most efficiently.
+ */
+ public static BoundingBox makeBoundingBox(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
+ final float upperRightY) {
+ final float[] array = new float[BoundingBox.QTY_ENTRIES];
+ array[BoundingBox.LOWER_LEFT_X_INDEX] = lowerLeftX;
+ array[BoundingBox.LOWER_LEFT_Y_INDEX] = lowerLeftY;
+ array[BoundingBox.UPPER_RIGHT_X_INDEX] = upperRightX;
+ array[BoundingBox.UPPER_RIGHT_Y_INDEX] = upperRightY;
+ return makeBoundingBox(array);
+ }
+
}
Added: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2021 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision: 11870 $
+ * $LastChangedDate: 2021-01-27 16:21:31 -0700 (Wed, 27 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.common.primitive;
+
+/**
+ * Utilities for the {@link java.lang.Float} and {@link java.lang.Float#TYPE}.
+ */
+public final class FloatUtils {
+
+ /**
+ * Private constructor. This is a utility class, and should never be instantiated.
+ */
+ private FloatUtils() { }
+
+ /**
+ * Indicates whether a given {@link java.lang.Float#TYPE} can cast to {@link java.lang.Integer#TYPE} without losing
+ * any data.
+ * @param input The value to be tested.
+ * @return True if and only if the float can be cast to {@link java.lang.Integer#TYPE} with no loss of data.
+ */
+ public static boolean isInteger(final float input) {
+ final int asInt = (int) input;
+ return asInt == input;
+ }
+
+ /**
+ * Indicates whether a given {@link java.lang.Float#TYPE} can cast to {@link java.lang.Short#TYPE} without losing
+ * any data.
+ * @param input The value to be tested.
+ * @return True if and only if the float can be cast to {@link java.lang.Short#TYPE} with no loss of data.
+ */
+ public static boolean isShort(final float input) {
+ final short asShort = (short) input;
+ return asShort == input;
+ }
+
+}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -30,7 +30,7 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
import org.foray.font.format.ttf.TrueTypeFont;
@@ -58,7 +58,7 @@
private TrueTypeFont ttf;
/** The font bbox. */
- private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxUtils.ZEROES;
/** The stemV value. */
private int stemV = 0;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,8 @@
package org.foray.font.format.ttf;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxShort;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.io.RandomAccessInput;
import org.axsl.common.data.BoundingBox;
@@ -53,7 +54,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private BoundingBox bbox = BoundingBoxFloat.ZEROES;
+ private BoundingBox bbox = BoundingBoxUtils.ZEROES;
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -97,7 +98,7 @@
final short bblly = raInput.readShort();
final short bburx = raInput.readShort();
final short bbury = raInput.readShort();
- head.bbox = new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
+ head.bbox = new BoundingBoxShort(bbllx, bblly, bburx, bbury);
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
/* Skip lowestRecPPEM. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.font.format.type1;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.primitive.BitUtils;
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
@@ -134,7 +134,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxUtils.ZEROES;
/** The parsed cap height. */
private int etmCapHeight;
@@ -734,7 +734,7 @@
* Computes the font bounding box.
* @return The font bounding box.
*/
- private BoundingBoxFloat computeFontBBox() {
+ private BoundingBox computeFontBBox() {
// Just guessing....
final int bbllx = getIsProportional() && getAverageWidth() == getMaxWidth() ? EST_BBOX_LL_X_PROPORTIONAL :
EST_BBOX_LL_X_FIXED;
@@ -741,7 +741,7 @@
final int bblly = -(getLowerCaseDescent() + EST_BBOX_LL_Y_ADJUST);
final int bburx = getMaxWidth() + EST_BBOX_UR_X_ADJUST;
final int bbury = getLowerCaseAscent() + EST_BBOX_UR_Y_ADJUST;
- return new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
+ return BoundingBoxUtils.makeBoundingBox(bbllx, bblly, bburx, bbury);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.font.format.type1;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.io.RandomAccessInput;
import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
@@ -1119,7 +1119,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
floats[i] = getFloat();
}
- final BoundingBoxFloat boundingBox = new BoundingBoxFloat(floats);
+ final BoundingBox boundingBox = BoundingBoxUtils.makeBoundingBox(floats);
this.metrics.setFontBBox(boundingBox);
}
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.font.format.ttf;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxShort;
import org.foray.common.io.SimpleDataSource;
import org.foray.font.FontServer4a;
import org.foray.font.format.FontContent;
@@ -86,7 +86,7 @@
*/
public static void assertionsForDejaVuSansExtraLightSet2(final TrueTypeFont ttfFont) {
/* The following values were obtained by opening the TTF file (not the TTC) in FontLab Studio 5.0.4. */
- final BoundingBox expected = new BoundingBoxFloat(-1501, -550, 3398, 2262);
+ final BoundingBox expected = new BoundingBoxShort(-1501, -550, 3398, 2262);
final BoundingBox actual = ttfFont.getFontBBox();
Assert.assertEquals(expected, actual);
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -30,7 +30,7 @@
import org.foray.common.ByteSequenceSearcher;
import org.foray.common.WellKnownConstants;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.data.BoundingBox;
@@ -269,7 +269,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
index += readBBoxString(fileStart, i, index, bboxArray);
}
- this.bbox = new BoundingBoxFloat(bboxArray);
+ this.bbox = BoundingBoxUtils.makeBoundingBox(bboxArray);
}
/**
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -29,7 +29,6 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
-import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.pdf.util.PdfGraphics2D;
@@ -108,7 +107,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBoxFloat(box);
+ return BoundingBoxUtils.makeBoundingBox(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -29,7 +29,6 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
-import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.pdf.util.PdfGraphics2D;
@@ -108,7 +107,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBoxFloat(box);
+ return BoundingBoxUtils.makeBoundingBox(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.pdf.object;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
@@ -101,7 +101,7 @@
@Override
protected BoundingBox getBoundingBox() {
/* TODO: Implement this. */
- return new BoundingBoxFloat(0, 0, 0, 0);
+ return BoundingBoxUtils.ZEROES;
}
@Override
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.ps.type1;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.ps.PsArray;
import org.foray.ps.PsDictionary;
import org.foray.ps.PsDictionaryWrapper;
@@ -124,7 +124,7 @@
return null;
}
}
- return new BoundingBoxFloat(fontBBox);
+ return BoundingBoxUtils.makeBoundingBox(fontBBox);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 17:32:21
|
Revision: 11873
http://sourceforge.net/p/foray/code/11873
Author: victormote
Date: 2021-01-28 17:32:18 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Move and rename the existing BoundingBox implementation.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
Copied: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java (from rev 11872, trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java)
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2006 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.common.data;
+
+import org.axsl.common.data.BoundingBox;
+
+import java.io.Serializable;
+
+/**
+ * <p>A bounding box, as commonly used in graphical applications.</p>
+ *
+ * <p>Instances of this class are immutable.</p>
+ */
+public class BoundingBoxFloat implements BoundingBox, Serializable {
+
+ /** An bounding box whose values are all zero, useful for initializing. */
+ public static final BoundingBoxFloat ZEROES = new BoundingBoxFloat(0, 0, 0, 0);
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = 1176678668590516253L;
+
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+
+ /** The lower-left X value. */
+ private float llx;
+
+ /** The lower-left Y value. */
+ private float lly;
+
+ /** The upper-right X value. */
+ private float urx;
+
+ /** The upper-right Y value. */
+ private float ury;
+
+ /**
+ * Constructor.
+ * @param lowerLeftX The lower-left X coordinate for the bounding box.
+ * @param lowerLeftY The lower-left Y coordinate for the bounding box.
+ * @param upperRightX The upper-right X coordinate for the bounding box.
+ * @param upperRightY The upper-right Y coordinate for the bounding box.
+ */
+ public BoundingBoxFloat(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
+ final float upperRightY) {
+ this.llx = lowerLeftX;
+ this.lly = lowerLeftY;
+ this.urx = upperRightX;
+ this.ury = upperRightY;
+ }
+
+ /**
+ * Constructor for a pre-existing float array.
+ * @param array The array containing the bounds.
+ * This array must have exactly four elements.
+ */
+ public BoundingBoxFloat(final float[] array) {
+ if (array.length != BoundingBox.QTY_ENTRIES) {
+ throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
+ }
+ this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
+ this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
+ this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
+ this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
+ }
+
+ @Override
+ public float getCoordinateAsFloat(final int index) {
+ switch(index) {
+ case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
+ case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
+ case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
+ case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
+ }
+ throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
+ }
+
+ @Override
+ public int getCoordinateAsInt(final int index) {
+ return (int) getCoordinateAsFloat(index);
+ }
+
+ @Override
+ public short getCoordinateAsShort(final int index) {
+ return (short) getCoordinateAsFloat(index);
+ }
+
+ @Override
+ public Class<? extends Number> getNativeType() {
+ return Float.TYPE;
+ }
+
+}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -1,118 +0,0 @@
-/*
- * Copyright 2006 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.ps;
-
-import org.axsl.common.data.BoundingBox;
-
-import java.io.Serializable;
-
-/**
- * <p>A bounding box, as commonly used in graphical applications.</p>
- *
- * <p>Instances of this class are immutable.</p>
- */
-public class BoundingBox4a implements BoundingBox, Serializable {
-
- /** An bounding box whose values are all zero, useful for initializing. */
- public static final BoundingBox4a ZEROES = new BoundingBox4a(0, 0, 0, 0);
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = 1176678668590516253L;
-
- /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
-
- /** The lower-left X value. */
- private float llx;
-
- /** The lower-left Y value. */
- private float lly;
-
- /** The upper-right X value. */
- private float urx;
-
- /** The upper-right Y value. */
- private float ury;
-
- /**
- * Constructor.
- * @param lowerLeftX The lower-left X coordinate for the bounding box.
- * @param lowerLeftY The lower-left Y coordinate for the bounding box.
- * @param upperRightX The upper-right X coordinate for the bounding box.
- * @param upperRightY The upper-right Y coordinate for the bounding box.
- */
- public BoundingBox4a(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
- final float upperRightY) {
- this.llx = lowerLeftX;
- this.lly = lowerLeftY;
- this.urx = upperRightX;
- this.ury = upperRightY;
- }
-
- /**
- * Constructor for a pre-existing float array.
- * @param array The array containing the bounds.
- * This array must have exactly four elements.
- */
- public BoundingBox4a(final float[] array) {
- if (array.length != BoundingBox.QTY_ENTRIES) {
- throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
- }
- this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
- this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
- this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
- this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
- }
-
- @Override
- public float getCoordinateAsFloat(final int index) {
- switch(index) {
- case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
- case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
- case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
- case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
- }
- throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
- }
-
- @Override
- public int getCoordinateAsInt(final int index) {
- return (int) getCoordinateAsFloat(index);
- }
-
- @Override
- public short getCoordinateAsShort(final int index) {
- return (short) getCoordinateAsFloat(index);
- }
-
- @Override
- public Class<? extends Number> getNativeType() {
- return Float.TYPE;
- }
-
-}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -30,7 +30,7 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
import org.foray.font.format.ttf.TrueTypeFont;
@@ -58,7 +58,7 @@
private TrueTypeFont ttf;
/** The font bbox. */
- private BoundingBox fontBBox = BoundingBox4a.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
/** The stemV value. */
private int stemV = 0;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.io.RandomAccessInput;
-import org.foray.common.ps.BoundingBox4a;
import org.axsl.common.data.BoundingBox;
@@ -53,7 +53,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private BoundingBox bbox = BoundingBox4a.ZEROES;
+ private BoundingBox bbox = BoundingBoxFloat.ZEROES;
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -97,7 +97,7 @@
final short bblly = raInput.readShort();
final short bburx = raInput.readShort();
final short bbury = raInput.readShort();
- head.bbox = new BoundingBox4a(bbllx, bblly, bburx, bbury);
+ head.bbox = new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
/* Skip lowestRecPPEM. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.type1;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.primitive.BitUtils;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
@@ -134,7 +134,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private BoundingBox fontBBox = BoundingBox4a.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
/** The parsed cap height. */
private int etmCapHeight;
@@ -734,7 +734,7 @@
* Computes the font bounding box.
* @return The font bounding box.
*/
- private BoundingBox4a computeFontBBox() {
+ private BoundingBoxFloat computeFontBBox() {
// Just guessing....
final int bbllx = getIsProportional() && getAverageWidth() == getMaxWidth() ? EST_BBOX_LL_X_PROPORTIONAL :
EST_BBOX_LL_X_FIXED;
@@ -741,7 +741,7 @@
final int bblly = -(getLowerCaseDescent() + EST_BBOX_LL_Y_ADJUST);
final int bburx = getMaxWidth() + EST_BBOX_UR_X_ADJUST;
final int bbury = getLowerCaseAscent() + EST_BBOX_UR_Y_ADJUST;
- return new BoundingBox4a(bbllx, bblly, bburx, bbury);
+ return new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.type1;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.io.RandomAccessInput;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.font.FontServer4a;
@@ -1119,7 +1119,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
floats[i] = getFloat();
}
- final BoundingBox4a boundingBox = new BoundingBox4a(floats);
+ final BoundingBoxFloat boundingBox = new BoundingBoxFloat(floats);
this.metrics.setFontBBox(boundingBox);
}
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.io.SimpleDataSource;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.font.FontServer4a;
import org.foray.font.format.FontContent;
import org.foray.font.format.FontParser;
@@ -86,7 +86,7 @@
*/
public static void assertionsForDejaVuSansExtraLightSet2(final TrueTypeFont ttfFont) {
/* The following values were obtained by opening the TTF file (not the TTC) in FontLab Studio 5.0.4. */
- final BoundingBox expected = new BoundingBox4a(-1501, -550, 3398, 2262);
+ final BoundingBox expected = new BoundingBoxFloat(-1501, -550, 3398, 2262);
final BoundingBox actual = ttfFont.getFontBBox();
Assert.assertEquals(expected, actual);
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -30,7 +30,7 @@
import org.foray.common.ByteSequenceSearcher;
import org.foray.common.WellKnownConstants;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.data.BoundingBox;
@@ -269,7 +269,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
index += readBBoxString(fileStart, i, index, bboxArray);
}
- this.bbox = new BoundingBox4a(bboxArray);
+ this.bbox = new BoundingBoxFloat(bboxArray);
}
/**
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -29,8 +29,8 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
import org.axsl.common.data.BoundingBox;
@@ -108,7 +108,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBox4a(box);
+ return new BoundingBoxFloat(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -29,8 +29,8 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
import org.axsl.common.data.BoundingBox;
@@ -108,7 +108,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBox4a(box);
+ return new BoundingBoxFloat(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,7 +28,7 @@
package org.foray.pdf.object;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
@@ -101,7 +101,7 @@
@Override
protected BoundingBox getBoundingBox() {
/* TODO: Implement this. */
- return new BoundingBox4a(0, 0, 0, 0);
+ return new BoundingBoxFloat(0, 0, 0, 0);
}
@Override
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,7 +28,7 @@
package org.foray.ps.type1;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.ps.PsArray;
import org.foray.ps.PsDictionary;
import org.foray.ps.PsDictionaryWrapper;
@@ -124,7 +124,7 @@
return null;
}
}
- return new BoundingBox4a(fontBBox);
+ return new BoundingBoxFloat(fontBBox);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 17:21:02
|
Revision: 11872
http://sourceforge.net/p/foray/code/11872
Author: victormote
Date: 2021-01-28 17:20:59 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Simplify BoundingBox interface: 1. Get all values using an index instead of explicit methods. 2. Provide methods to retrieve values as int and short, to provide potential performance improvements.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
Added: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2021 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision: 11871 $
+ * $LastChangedDate: 2021-01-28 07:52:03 -0700 (Thu, 28 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.common.data;
+
+import org.axsl.common.data.BoundingBox;
+
+/**
+ * Utilities related to bounding boxes.
+ */
+public final class BoundingBoxUtils {
+
+ /**
+ * Private constructor.
+ * This is a utility class, and should never be instantiated.
+ */
+ private BoundingBoxUtils() { }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeWidthAsFloat(final BoundingBox bBox) {
+ final float urx = bBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float llx = bBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ return urx - llx;
+ }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeHeightAsFloat(final BoundingBox bBox) {
+ final float ury = bBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final float lly = bBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
+ return ury - lly;
+ }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeWidthAsInt(final BoundingBox bBox) {
+ final int urx = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final int llx = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_X_INDEX);
+ return urx - llx;
+ }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeHeightAsInt(final BoundingBox bBox) {
+ final int ury = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final int lly = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_Y_INDEX);
+ return ury - lly;
+ }
+
+ /**
+ * Tests the equality of the values in two {@link BoundingBox} instances.
+ * @param box1 The first box to test.
+ * @param box2 The second box to test.
+ * @return True if and only if each corresponding element in one box is equal to the other.
+ */
+ public static boolean equals(final BoundingBox box1, final BoundingBox box2) {
+ /* First, check for equality by float values. */
+ boolean floatEquals = true;
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final float value1 = box1.getCoordinateAsFloat(index);
+ final float value2 = box2.getCoordinateAsFloat(index);
+ if (value1 != value2) {
+ floatEquals = false;
+ break;
+ }
+ }
+ if (floatEquals) {
+ return true;
+ }
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final int value1 = box1.getCoordinateAsInt(index);
+ final int value2 = box2.getCoordinateAsInt(index);
+ if (value1 != value2) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -45,9 +45,20 @@
/** Constant needed for serialization. */
private static final long serialVersionUID = 1176678668590516253L;
- /** The array storing the elements of the bounding box. */
- private float[] array;
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+ /** The lower-left X value. */
+ private float llx;
+
+ /** The lower-left Y value. */
+ private float lly;
+
+ /** The upper-right X value. */
+ private float urx;
+
+ /** The upper-right Y value. */
+ private float ury;
+
/**
* Constructor.
* @param lowerLeftX The lower-left X coordinate for the bounding box.
@@ -57,11 +68,10 @@
*/
public BoundingBox4a(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
final float upperRightY) {
- this.array = new float[BoundingBox.QTY_ENTRIES];
- this.array[BoundingBox.LOWER_LEFT_X_INDEX] = lowerLeftX;
- this.array[BoundingBox.LOWER_LEFT_Y_INDEX] = lowerLeftY;
- this.array[BoundingBox.UPPER_RIGHT_X_INDEX] = upperRightX;
- this.array[BoundingBox.UPPER_RIGHT_Y_INDEX] = upperRightY;
+ this.llx = lowerLeftX;
+ this.lly = lowerLeftY;
+ this.urx = upperRightX;
+ this.ury = upperRightY;
}
/**
@@ -73,66 +83,36 @@
if (array.length != BoundingBox.QTY_ENTRIES) {
throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
}
- this.array = array;
+ this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
+ this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
+ this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
+ this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
}
@Override
- public float getWidth() {
- return this.array[UPPER_RIGHT_X_INDEX] - this.array[LOWER_LEFT_X_INDEX];
-
+ public float getCoordinateAsFloat(final int index) {
+ switch(index) {
+ case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
+ case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
+ case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
+ case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
+ }
+ throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
}
@Override
- public float getHeight() {
- return this.array[UPPER_RIGHT_Y_INDEX] - this.array[LOWER_LEFT_Y_INDEX];
+ public int getCoordinateAsInt(final int index) {
+ return (int) getCoordinateAsFloat(index);
}
@Override
- public float getLowerLeftX() {
- return this.array[LOWER_LEFT_X_INDEX];
+ public short getCoordinateAsShort(final int index) {
+ return (short) getCoordinateAsFloat(index);
}
@Override
- public float getLowerLeftY() {
- return this.array[LOWER_LEFT_Y_INDEX];
+ public Class<? extends Number> getNativeType() {
+ return Float.TYPE;
}
- @Override
- public float getUpperRightX() {
- return this.array[UPPER_RIGHT_X_INDEX];
- }
-
- @Override
- public float getUpperRightY() {
- return this.array[UPPER_RIGHT_Y_INDEX];
- }
-
- @Override
- public float getCoordinate(final int index) {
- return this.array[index];
- }
-
- @Override
- public float[] getArray() {
- final float[] returnValue = new float[BoundingBox.QTY_ENTRIES];
- System.arraycopy(this.array, 0, returnValue, 0, BoundingBox.QTY_ENTRIES);
- return returnValue;
- }
-
- @Override
- public boolean equals(final Object other) {
- if (! (other instanceof BoundingBox)) {
- return false;
- }
- final BoundingBox bbOther = (BoundingBox) other;
- for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
- final float valueThis = getCoordinate(index);
- final float valueOther = bbOther.getCoordinate(index);
- if (valueThis != valueOther) {
- return false;
- }
- }
- return true;
- }
-
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -141,7 +141,7 @@
final StringBuilder buffer = new StringBuilder();
buffer.append("FontBBox: [");
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
- buffer.append((int) bbox.getCoordinate(i));
+ buffer.append(bbox.getCoordinateAsInt(i));
if (i < BoundingBox.QTY_ENTRIES - 1) {
buffer.append(" ");
} else {
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -89,10 +89,10 @@
Assert.assertEquals("Utopia-Regular", fontDict.getFontName());
final BoundingBox fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(-158, fontBBox.getCoordinate(0), 0);
- Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
- Assert.assertEquals(1158, fontBBox.getCoordinate(2), 0);
- Assert.assertEquals(890, fontBBox.getCoordinate(3), 0);
+ Assert.assertEquals(-158, fontBBox.getCoordinateAsInt(0));
+ Assert.assertEquals(-250, fontBBox.getCoordinateAsInt(1));
+ Assert.assertEquals(1158, fontBBox.getCoordinateAsInt(2));
+ Assert.assertEquals(890, fontBBox.getCoordinateAsInt(3));
Assert.assertEquals("Regular", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -89,10 +89,10 @@
Assert.assertEquals("CMR10", fontDict.getFontName());
final BoundingBox fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(-251, fontBBox.getCoordinate(0), 0);
- Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
- Assert.assertEquals(1009, fontBBox.getCoordinate(2), 0);
- Assert.assertEquals(969, fontBBox.getCoordinate(3), 0);
+ Assert.assertEquals(-251, fontBBox.getCoordinateAsInt(0));
+ Assert.assertEquals(-250, fontBBox.getCoordinateAsInt(1));
+ Assert.assertEquals(1009, fontBBox.getCoordinateAsInt(2));
+ Assert.assertEquals(969, fontBBox.getCoordinateAsInt(3));
Assert.assertEquals("Medium", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -203,12 +203,12 @@
}
readBBox(fileStart);
if (this.bbox != null) {
- final float xUR = this.bbox.getUpperRightX();
- final float xLL = this.bbox.getLowerLeftX();
+ final float xUR = this.bbox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float xLL = this.bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
final float pixelWidth = xUR - xLL;
this.pixelWidth = Math.round(pixelWidth);
- final float yUR = this.bbox.getUpperRightY();
- final float yLL = this.bbox.getLowerLeftY();
+ final float yUR = this.bbox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final float yLL = this.bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
final float pixelHeight = yUR - yLL;
this.pixelHeight = Math.round(pixelHeight);
} else {
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -103,10 +103,10 @@
@Override
protected String specialXObjectDictEntries(final PdfDocument4a doc) throws GraphicException {
final BoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.getLowerLeftX();
- final float lly = boundingBox.getLowerLeftY();
- final float urx = boundingBox.getUpperRightX();
- final float ury = boundingBox.getUpperRightY();
+ final float llx = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float lly = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
+ final float urx = boundingBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float ury = boundingBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
final StringBuilder buffer = new StringBuilder();
buffer.append("/FormType 1" + EOL);
buffer.append("/BBox [");
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -85,10 +85,10 @@
* @param bBox A bounding box.
*/
public PdfRectangle(final BoundingBox bBox) {
- this.llx = (int) bBox.getLowerLeftX();
- this.lly = (int) bBox.getLowerLeftY();
- this.urx = (int) bBox.getUpperRightX();
- this.ury = (int) bBox.getUpperRightY();
+ this.llx = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_X_INDEX);
+ this.lly = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_Y_INDEX);
+ this.urx = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_X_INDEX);
+ this.ury = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_Y_INDEX);
}
/**
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -28,6 +28,7 @@
package org.foray.pdf.object;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.data.BoundingBox;
@@ -91,7 +92,7 @@
public float getHorizontalScaling(
final Rectangle2D.Float contentRectangle) {
final EpsGraphic eps = this.getGraphic();
- final float graphicWidth = eps.getBoundingBox().getWidth();
+ final float graphicWidth = BoundingBoxUtils.computeWidthAsFloat(eps.getBoundingBox());
return contentRectangle.width / graphicWidth;
}
@@ -98,7 +99,7 @@
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) {
final EpsGraphic eps = this.getGraphic();
- final float graphicHeight = eps.getBoundingBox().getHeight();
+ final float graphicHeight = BoundingBoxUtils.computeHeightAsFloat(eps.getBoundingBox());
return contentRectangle.height / graphicHeight;
}
@@ -120,8 +121,8 @@
@Override
protected AffineTransform getUserSpaceTransform() {
final BoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.getLowerLeftX();
- final float lly = boundingBox.getLowerLeftY();
+ final float llx = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float lly = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
float xTranslate = 0;
if (llx < 0) {
/* If the bounding box of the graphic is negative, adjust it up to
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -29,6 +29,7 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
@@ -85,13 +86,13 @@
@Override
public float getHorizontalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicWidth = getBoundingBox().getWidth();
+ final float graphicWidth = BoundingBoxUtils.computeWidthAsFloat(getBoundingBox());
return contentRectangle.width / graphicWidth;
}
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicHeight = getBoundingBox().getHeight();
+ final float graphicHeight = BoundingBoxUtils.computeHeightAsFloat(getBoundingBox());
return contentRectangle.height / graphicHeight;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -29,6 +29,7 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
@@ -85,13 +86,13 @@
@Override
public float getHorizontalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicWidth = getBoundingBox().getWidth();
+ final float graphicWidth = BoundingBoxUtils.computeWidthAsFloat(getBoundingBox());
return contentRectangle.width / graphicWidth;
}
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicHeight = getBoundingBox().getHeight();
+ final float graphicHeight = BoundingBoxUtils.computeHeightAsFloat(getBoundingBox());
return contentRectangle.height / graphicHeight;
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -37,6 +37,7 @@
import org.foray.common.CharacterOutputStream;
import org.foray.common.Mime;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.primitive.StringUtils;
import org.foray.common.sequence.ByteArray;
import org.foray.render.PrintRenderer;
@@ -672,8 +673,8 @@
public byte[] epsToPostScript(final EpsGraphic image, final int x,
final int y, final int w, final int h) throws GraphicException {
final BoundingBox bbox = image.getBoundingBox();
- final float bboxw = bbox.getWidth();
- final float bboxh = bbox.getHeight();
+ final float bboxw = BoundingBoxUtils.computeWidthAsFloat(bbox);
+ final float bboxh = BoundingBoxUtils.computeHeightAsFloat(bbox);
StringBuilder buffer = new StringBuilder();
buffer.append("%%BeginDocument: " + image.getName());
@@ -682,9 +683,18 @@
buffer.append(x + " " + (y - h) + " translate");
buffer.append("0.0 rotate");
buffer.append((long) (w / bboxw) + " " + (long) (h / bboxh) + " scale");
- buffer.append(-bbox.getLowerLeftX() + " " + (-bbox.getLowerLeftY()) + " translate");
- buffer.append(bbox.getLowerLeftX() + " " + bbox.getLowerLeftY() + " " + bboxw + " " + bboxh
- + " rectclip");
+ buffer.append(-bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
+ buffer.append(" ");
+ buffer.append(-bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
+ buffer.append(" translate");
+ buffer.append(bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
+ buffer.append(" ");
+ buffer.append(bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
+ buffer.append(" ");
+ buffer.append(bboxw);
+ buffer.append(" ");
+ buffer.append(bboxh);
+ buffer.append(" rectclip");
buffer.append("newpath");
final String string1 = buffer.toString();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 14:52:15
|
Revision: 11871
http://sourceforge.net/p/foray/code/11871
Author: victormote
Date: 2021-01-28 14:52:03 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Convert use of bounding box arrays to BoundingBox.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -30,11 +30,21 @@
import org.axsl.common.data.BoundingBox;
+import java.io.Serializable;
+
/**
- * A PostScript bounding box.
+ * <p>A bounding box, as commonly used in graphical applications.</p>
+ *
+ * <p>Instances of this class are immutable.</p>
*/
-public class BoundingBox4a implements BoundingBox {
+public class BoundingBox4a implements BoundingBox, Serializable {
+ /** An bounding box whose values are all zero, useful for initializing. */
+ public static final BoundingBox4a ZEROES = new BoundingBox4a(0, 0, 0, 0);
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = 1176678668590516253L;
+
/** The array storing the elements of the bounding box. */
private float[] array;
@@ -109,4 +119,20 @@
return returnValue;
}
+ @Override
+ public boolean equals(final Object other) {
+ if (! (other instanceof BoundingBox)) {
+ return false;
+ }
+ final BoundingBox bbOther = (BoundingBox) other;
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final float valueThis = getCoordinate(index);
+ final float valueOther = bbOther.getCoordinate(index);
+ if (valueThis != valueOther) {
+ return false;
+ }
+ }
+ return true;
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -34,6 +34,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
import org.axsl.ps.CharSet;
@@ -201,7 +202,7 @@
* Returns the bounding box for this font.
* @return The bounding box for this font.
*/
- public abstract int[] getFontBBox();
+ public abstract BoundingBox getFontBBox();
@Override
public int getFlags() {
@@ -573,7 +574,7 @@
}
@Override
- public int[] getBoundingBox() {
+ public BoundingBox getBoundingBox() {
return getFontBBox();
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -30,11 +30,13 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
import org.foray.font.format.ttf.TrueTypeFont;
import org.foray.font.format.ttf.TtfSubSetFile;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
@@ -56,7 +58,7 @@
private TrueTypeFont ttf;
/** The font bbox. */
- private int[] fontBBox = {0, 0, 0, 0};
+ private BoundingBox fontBBox = BoundingBox4a.ZEROES;
/** The stemV value. */
private int stemV = 0;
@@ -155,7 +157,7 @@
}
@Override
- public int[] getFontBBox() {
+ public BoundingBox getFontBBox() {
return this.fontBBox;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -38,6 +38,7 @@
import org.foray.font.format.type1.Type1Metrics;
import org.foray.font.format.type1.Type1MetricsParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
import org.axsl.ps.PsEncoding;
@@ -207,8 +208,8 @@
}
@Override
- public int[] getFontBBox() {
- int[] bbox = null;
+ public BoundingBox getFontBBox() {
+ BoundingBox bbox = null;
/* Check the AFM file first as that is the cleanest and most
* efficient. */
if (this.metricsFile.getFormat() == Type1Metrics.Format.AFM) {
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -35,6 +35,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.axsl.ps.CharSet;
@@ -563,7 +564,7 @@
}
@Override
- public int[] getBoundingBox() {
+ public BoundingBox getBoundingBox() {
return null;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -35,6 +35,7 @@
import org.foray.font.format.FontParserClient;
import org.foray.font.format.type1.Type1MetricsSerializer;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.apache.commons.cli.CommandLine;
@@ -136,12 +137,12 @@
logger.info("");
logger.info("Ascender: " + font.getAscender());
logger.info("Descender: " + font.getDescender());
- final int[] bbox = font.getFontBBox();
+ final BoundingBox bbox = font.getFontBBox();
final StringBuilder buffer = new StringBuilder();
buffer.append("FontBBox: [");
- for (int i = 0; i < bbox.length; i++) {
- buffer.append(bbox[i]);
- if (i < bbox.length - 1) {
+ for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
+ buffer.append((int) bbox.getCoordinate(i));
+ if (i < BoundingBox.QTY_ENTRIES - 1) {
buffer.append(" ");
} else {
buffer.append("]");
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -36,6 +36,7 @@
import org.foray.font.format.Panose4a;
import org.foray.font.output.FontPdfUtilities;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.ps.Cmap;
@@ -641,7 +642,7 @@
* Returns the bounding box for this font.
* @return The bounding box for this font.
*/
- public int[] getFontBBox() {
+ public BoundingBox getFontBBox() {
return this.headTable.getBbox();
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,6 +29,7 @@
package org.foray.font.format.ttf;
import org.foray.common.io.RandomAccessInput;
+import org.foray.common.ps.BoundingBox4a;
import org.axsl.common.data.BoundingBox;
@@ -52,7 +53,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private int[] bbox = new int[BoundingBox.QTY_ENTRIES];
+ private BoundingBox bbox = BoundingBox4a.ZEROES;
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -92,14 +93,11 @@
/* Skip modified date. */
raInput.skipBytes(LONG_DATE_TIME_BYTES);
/* Read the bounding box. */
- head.bbox[BoundingBox.LOWER_LEFT_X_INDEX]
- = raInput.readShort();
- head.bbox[BoundingBox.LOWER_LEFT_Y_INDEX]
- = raInput.readShort();
- head.bbox[BoundingBox.UPPER_RIGHT_X_INDEX]
- = raInput.readShort();
- head.bbox[BoundingBox.UPPER_RIGHT_Y_INDEX]
- = raInput.readShort();
+ final short bbllx = raInput.readShort();
+ final short bblly = raInput.readShort();
+ final short bburx = raInput.readShort();
+ final short bbury = raInput.readShort();
+ head.bbox = new BoundingBox4a(bbllx, bblly, bburx, bbury);
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
/* Skip lowestRecPPEM. */
@@ -138,7 +136,7 @@
* Returns the bounding box for this font.
* @return The bounding box for this font.
*/
- public int[] getBbox() {
+ public BoundingBox getBbox() {
return this.bbox;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,6 +29,7 @@
package org.foray.font.format.type1;
import org.foray.common.primitive.BitUtils;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
@@ -133,7 +134,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private int[] fontBBox = new int[BoundingBox.QTY_ENTRIES];
+ private BoundingBox fontBBox = BoundingBox4a.ZEROES;
/** The parsed cap height. */
private int etmCapHeight;
@@ -378,24 +379,18 @@
/**
* Set the bounding box.
- * @param index The fontBBox index to set.
- * @param value The value to set.
+ * @param newBoundingBox The fontBBox index to set.
*/
- public void setFontBBox(final int index, final int value) {
- if (index < 0
- || index >= BoundingBox.QTY_ENTRIES) {
- return;
- }
- this.fontBBox[index] = value;
+ public void setFontBBox(final BoundingBox newBoundingBox) {
+ this.fontBBox = newBoundingBox;
}
/**
* Returns the bounding box for the font.
- * Note: this value is just an approximation, it does not really exist in
- * the PFM file.
+ * Note: this value is just an approximation, it does not really exist in the PFM file.
* @return The calculated Font BBox.
*/
- public int[] getFontBBox() {
+ public BoundingBox getFontBBox() {
if (this.fontBBox == null) {
this.fontBBox = computeFontBBox();
}
@@ -739,23 +734,14 @@
* Computes the font bounding box.
* @return The font bounding box.
*/
- private int[] computeFontBBox() {
- final int[] bbox = new int[BoundingBox.QTY_ENTRIES];
-
+ private BoundingBox4a computeFontBBox() {
// Just guessing....
- if (!getIsProportional() && (getAverageWidth() == getMaxWidth())) {
- bbox[BoundingBox.LOWER_LEFT_X_INDEX] = EST_BBOX_LL_X_FIXED;
- } else {
- bbox[BoundingBox.LOWER_LEFT_X_INDEX] =
- EST_BBOX_LL_X_PROPORTIONAL;
- }
- bbox[BoundingBox.LOWER_LEFT_Y_INDEX] = -(getLowerCaseDescent()
- + EST_BBOX_LL_Y_ADJUST);
- bbox[BoundingBox.UPPER_RIGHT_X_INDEX] = getMaxWidth()
- + EST_BBOX_UR_X_ADJUST;
- bbox[BoundingBox.UPPER_RIGHT_Y_INDEX] = getLowerCaseAscent()
- + EST_BBOX_UR_Y_ADJUST;
- return bbox;
+ final int bbllx = getIsProportional() && getAverageWidth() == getMaxWidth() ? EST_BBOX_LL_X_PROPORTIONAL :
+ EST_BBOX_LL_X_FIXED;
+ final int bblly = -(getLowerCaseDescent() + EST_BBOX_LL_Y_ADJUST);
+ final int bburx = getMaxWidth() + EST_BBOX_UR_X_ADJUST;
+ final int bbury = getLowerCaseAscent() + EST_BBOX_UR_Y_ADJUST;
+ return new BoundingBox4a(bbllx, bblly, bburx, bbury);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,6 +29,7 @@
package org.foray.font.format.type1;
import org.foray.common.io.RandomAccessInput;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.font.FontServer4a;
@@ -1114,9 +1115,12 @@
* Process a "FontBBox" keyword.
*/
private void fontBBox() {
+ final float[] floats = new float[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
- this.metrics.setFontBBox(i, Math.round(getFloat()));
+ floats[i] = getFloat();
}
+ final BoundingBox4a boundingBox = new BoundingBox4a(floats);
+ this.metrics.setFontBBox(boundingBox);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -31,6 +31,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.IntArray;
+import org.axsl.common.data.BoundingBox;
import org.axsl.common.i18n.Orthography;
import org.axsl.common.sequence.IntSequence;
import org.axsl.font.Font;
@@ -259,7 +260,7 @@
}
@Override
- public int[] getBoundingBox() {
+ public BoundingBox getBoundingBox() {
// TODO Auto-generated method stub
return null;
}
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,10 +29,12 @@
package org.foray.font.format.ttf;
import org.foray.common.io.SimpleDataSource;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.font.FontServer4a;
import org.foray.font.format.FontContent;
import org.foray.font.format.FontParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.junit.Assert;
@@ -84,14 +86,10 @@
*/
public static void assertionsForDejaVuSansExtraLightSet2(final TrueTypeFont ttfFont) {
/* The following values were obtained by opening the TTF file (not the TTC) in FontLab Studio 5.0.4. */
- final int[] expectedBbox = {-1501, -550, 3398, 2262};
+ final BoundingBox expected = new BoundingBox4a(-1501, -550, 3398, 2262);
- final int[] bbox = ttfFont.getFontBBox();
- Assert.assertEquals(4, bbox.length);
- Assert.assertEquals(expectedBbox[0], bbox[0]);
- Assert.assertEquals(expectedBbox[1], bbox[1]);
- Assert.assertEquals(expectedBbox[2], bbox[2]);
- Assert.assertEquals(expectedBbox[3], bbox[3]);
+ final BoundingBox actual = ttfFont.getFontBBox();
+ Assert.assertEquals(expected, actual);
}
/**
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -32,6 +32,7 @@
import org.foray.font.FontServer4a;
import org.foray.font.format.FontParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.axsl.ps.PsCharStringsDictionary;
import org.axsl.ps.PsFontDictionary;
@@ -87,12 +88,11 @@
Assert.assertEquals("Utopia-Regular", fontDict.getFontName());
- final int[] fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(4, fontBBox.length);
- Assert.assertEquals(-158, fontBBox[0]);
- Assert.assertEquals(-250, fontBBox[1]);
- Assert.assertEquals(1158, fontBBox[2]);
- Assert.assertEquals(890, fontBBox[3]);
+ final BoundingBox fontBBox = fontDict.getFontBbox();
+ Assert.assertEquals(-158, fontBBox.getCoordinate(0), 0);
+ Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
+ Assert.assertEquals(1158, fontBBox.getCoordinate(2), 0);
+ Assert.assertEquals(890, fontBBox.getCoordinate(3), 0);
Assert.assertEquals("Regular", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -32,6 +32,7 @@
import org.foray.font.FontServer4a;
import org.foray.font.format.FontParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.axsl.ps.PsCharStringsDictionary;
import org.axsl.ps.PsFontDictionary;
@@ -87,12 +88,11 @@
Assert.assertEquals("CMR10", fontDict.getFontName());
- final int[] fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(4, fontBBox.length);
- Assert.assertEquals(-251, fontBBox[0]);
- Assert.assertEquals(-250, fontBBox[1]);
- Assert.assertEquals(1009, fontBBox[2]);
- Assert.assertEquals(969, fontBBox[3]);
+ final BoundingBox fontBBox = fontDict.getFontBbox();
+ Assert.assertEquals(-251, fontBBox.getCoordinate(0), 0);
+ Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
+ Assert.assertEquals(1009, fontBBox.getCoordinate(2), 0);
+ Assert.assertEquals(969, fontBBox.getCoordinate(3), 0);
Assert.assertEquals("Medium", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -28,6 +28,8 @@
package org.foray.pdf.object;
+import org.axsl.common.data.BoundingBox;
+
import java.io.UnsupportedEncodingException;
/**
@@ -79,6 +81,17 @@
}
/**
+ * Create a rectangle from a bounding box.
+ * @param bBox A bounding box.
+ */
+ public PdfRectangle(final BoundingBox bBox) {
+ this.llx = (int) bBox.getLowerLeftX();
+ this.lly = (int) bBox.getLowerLeftY();
+ this.urx = (int) bBox.getUpperRightX();
+ this.ury = (int) bBox.getUpperRightY();
+ }
+
+ /**
* Produce the PDF representation for the object.
* @return the PDF
*/
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -28,6 +28,7 @@
package org.foray.ps.type1;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.ps.PsArray;
import org.foray.ps.PsDictionary;
import org.foray.ps.PsDictionaryWrapper;
@@ -103,7 +104,7 @@
}
@Override
- public int[] getFontBbox() {
+ public BoundingBox getFontBbox() {
final Object object = this.getWrappedDictionary().getItem(PsFontDictionary4a.FONT_BBOX_KEY);
if (! (object instanceof PsArray)) {
return null;
@@ -112,7 +113,7 @@
if (psarray.size() != BoundingBox.QTY_ENTRIES) {
return null;
}
- final int[] fontBBox = new int[BoundingBox.QTY_ENTRIES];
+ final float[] fontBBox = new float[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < psarray.size(); i++) {
final Object arrayItem = psarray.get(i);
if (arrayItem instanceof PsInteger) {
@@ -123,7 +124,7 @@
return null;
}
}
- return fontBBox;
+ return new BoundingBox4a(fontBBox);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|