Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
iText io.jar Source Code
io.jar is a component in iText Java library to provide input/output functionalities. iText Java library allows you to generate and manage PDF documents.
The Source Code files are provided together with the JAR file in the binary packge like iText7-Core-7.1.4.zip. You can download it at iText 7 Core Download site.
You can compile it to generate your JAR file, using io.pom as the build configuration file.
The source code of io-7.1.4.jar is provided below:
✍: FYIcenter.com
⏎ com/itextpdf/io/font/otf/GposLookupType2.java
/* This file is part of the iText (R) project. Copyright (c) 1998-2018 iText Group NV Authors: Bruno Lowagie, Paulo Soares, et al. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation with the addition of the following permission added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program; if not, see http://www.gnu.org/licenses or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, 02110-1301 USA, or download the license from the following URL: http://itextpdf.com/terms-of-use/ The interactive user interfaces in modified source and object code versions of this program must display Appropriate Legal Notices, as required under Section 5 of the GNU Affero General Public License. In accordance with Section 7(b) of the GNU Affero General Public License, a covered work must retain the producer line in every PDF that is created or manipulated using iText. You can be released from the requirements of the license by purchasing a commercial license. Buying such a license is mandatory as soon as you develop commercial activities involving the iText software without disclosing the source code of your own applications. These activities include: offering paid services to customers as an ASP, serving PDFs on the fly in a web application, shipping iText with a closed source product. For more information, please contact iText Software Corp. at this address: sales@itextpdf.com */ package com.itextpdf.io.font.otf; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; /** * Lookup Type 2: * Pair Adjustment Positioning Subtable */ public class GposLookupType2 extends OpenTableLookup { private static final long serialVersionUID = 4781829862270887603L; private List<OpenTableLookup> listRules = new ArrayList<>(); public GposLookupType2(OpenTypeFontTableReader openReader, int lookupFlag, int[] subTableLocations) throws java.io.IOException { super(openReader, lookupFlag, subTableLocations); readSubTables(); } @Override public boolean transformOne(GlyphLine line) { if (line.idx >= line.end) return false; if (openReader.isSkip(line.get(line.idx).getCode(), lookupFlag)) { line.idx++; return false; } for (OpenTableLookup lookup : listRules) { if (lookup.transformOne(line)) return true; } ++line.idx; return false; } @Override protected void readSubTable(int subTableLocation) throws java.io.IOException { openReader.rf.seek(subTableLocation); int gposFormat = openReader.rf.readShort(); switch (gposFormat) { case 1: { PairPosAdjustmentFormat1 format1 = new PairPosAdjustmentFormat1(openReader, lookupFlag, subTableLocation); listRules.add(format1); break; } case 2: { PairPosAdjustmentFormat2 format2 = new PairPosAdjustmentFormat2(openReader, lookupFlag, subTableLocation); listRules.add(format2); break; } } } private static class PairPosAdjustmentFormat1 extends OpenTableLookup { private static final long serialVersionUID = -5556528810086852702L; private Map<Integer,Map<Integer,PairValueFormat>> gposMap = new HashMap<>(); public PairPosAdjustmentFormat1(OpenTypeFontTableReader openReader, int lookupFlag, int subtableLocation) throws java.io.IOException { super(openReader, lookupFlag, null); readFormat(subtableLocation); } public boolean transformOne(GlyphLine line) { if (line.idx >= line.end || line.idx < line.start) return false; boolean changed = false; Glyph g1 = line.get(line.idx); Map<Integer,PairValueFormat> m = gposMap.get(g1.getCode()); if (m != null) { GlyphIndexer gi = new GlyphIndexer(); gi.line = line; gi.idx = line.idx; gi.nextGlyph(openReader, lookupFlag); if (gi.glyph != null) { PairValueFormat pv = m.get(gi.glyph.getCode()); if (pv != null) { Glyph g2 = gi.glyph; line.set(line.idx, new Glyph(g1, 0, 0, pv.first.XAdvance, pv.first.YAdvance, 0)); line.set(gi.idx, new Glyph(g2, 0, 0, pv.second.XAdvance, pv.second.YAdvance, 0)); line.idx = gi.idx; changed = true; } } } return changed; } protected void readFormat(int subTableLocation) throws java.io.IOException { int coverage = openReader.rf.readUnsignedShort() + subTableLocation; int valueFormat1 = openReader.rf.readUnsignedShort(); int valueFormat2 = openReader.rf.readUnsignedShort(); int pairSetCount = openReader.rf.readUnsignedShort(); int[] locationRule = openReader.readUShortArray(pairSetCount, subTableLocation); List<Integer> coverageList = openReader.readCoverageFormat(coverage); for (int k = 0; k < pairSetCount; ++k) { openReader.rf.seek(locationRule[k]); Map<Integer,PairValueFormat> pairs = new HashMap<>(); gposMap.put(coverageList.get(k), pairs); int pairValueCount = openReader.rf.readUnsignedShort(); for (int j = 0; j < pairValueCount; ++j) { int glyph2 = openReader.rf.readUnsignedShort(); PairValueFormat pair = new PairValueFormat(); pair.first = OtfReadCommon.readGposValueRecord(openReader, valueFormat1); pair.second = OtfReadCommon.readGposValueRecord(openReader, valueFormat2); pairs.put(glyph2, pair); } } } @Override protected void readSubTable(int subTableLocation) throws java.io.IOException { //never called here } } private static class PairPosAdjustmentFormat2 extends OpenTableLookup { private static final long serialVersionUID = 3056620748845862393L; private OtfClass classDef1; private OtfClass classDef2; private HashSet<Integer> coverageSet; private Map<Integer,PairValueFormat[]> posSubs = new HashMap<>(); public PairPosAdjustmentFormat2(OpenTypeFontTableReader openReader, int lookupFlag, int subtableLocation) throws java.io.IOException { super(openReader, lookupFlag, null); readFormat(subtableLocation); } public boolean transformOne(GlyphLine line) { if (line.idx >= line.end || line.idx < line.start) return false; Glyph g1 = line.get(line.idx); if (!coverageSet.contains(g1.getCode())) return false; int c1 = classDef1.getOtfClass(g1.getCode()); PairValueFormat[] pvs = posSubs.get(c1); if (pvs == null) return false; GlyphIndexer gi = new GlyphIndexer(); gi.line = line; gi.idx = line.idx; gi.nextGlyph(openReader, lookupFlag); if (gi.glyph == null) return false; Glyph g2 = gi.glyph; int c2 = classDef2.getOtfClass(g2.getCode()); if (c2 >= pvs.length) return false; PairValueFormat pv = pvs[c2]; line.set(line.idx, new Glyph(g1, 0, 0, pv.first.XAdvance, pv.first.YAdvance, 0)); line.set(gi.idx, new Glyph(g2, 0, 0, pv.second.XAdvance, pv.second.YAdvance, 0)); line.idx = gi.idx; return true; } protected void readFormat(int subTableLocation) throws java.io.IOException { int coverage = openReader.rf.readUnsignedShort()+ subTableLocation; int valueFormat1 = openReader.rf.readUnsignedShort(); int valueFormat2 = openReader.rf.readUnsignedShort(); int locationClass1 = openReader.rf.readUnsignedShort() + subTableLocation; int locationClass2 = openReader.rf.readUnsignedShort() + subTableLocation; int class1Count = openReader.rf.readUnsignedShort(); int class2Count = openReader.rf.readUnsignedShort(); for (int k = 0; k < class1Count; ++k) { PairValueFormat[] pairs = new PairValueFormat[class2Count]; posSubs.put(k, pairs); for (int j = 0; j < class2Count; ++j) { PairValueFormat pair = new PairValueFormat(); pair.first = OtfReadCommon.readGposValueRecord(openReader, valueFormat1); pair.second = OtfReadCommon.readGposValueRecord(openReader, valueFormat2); pairs[j] = pair; } } coverageSet = new HashSet<>(openReader.readCoverageFormat(coverage)); classDef1 = openReader.readClassDefinition(locationClass1); classDef2 = openReader.readClassDefinition(locationClass2); } @Override protected void readSubTable(int subTableLocation) throws java.io.IOException { //never called here } } private static class PairValueFormat implements Serializable { private static final long serialVersionUID = -6442882035589529495L; public GposValueRecord first; public GposValueRecord second; } }
⏎ com/itextpdf/io/font/otf/GposLookupType2.java
Or download all of them as a single archive file:
File name: io-7.1.4-sources.jar File size: 608762 bytes Release date: 2018-10-09 Download
⇒ iText layout.jar Source Code
⇐ iText kernel.jar Source Code
2018-04-09, 91489👍, 5💬
Popular Posts:
Swingx is the SwingLabs Swing Component Extensions. JAR File Size and Download Location: File name: ...
ASM is an all purpose Java bytecode manipulation and analysis framework. It can be used to modify ex...
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...
What Is log4j-1.2.13.jar? I got the JAR file from logging-log4j-1.2.13.zip .log4j-1.2.13.jar is the ...