/** * The function finds for the FD array processed the local subr offset and its * offset array. * * @param Font the font * @param FD The FDARRAY processed */ protected void BuildFDSubrsOffsets(int Font, int FD) { // Initiate to -1 to indicate lsubr operator present fonts[Font].PrivateSubrsOffset[FD] = -1; // Goto beginning of objects seek(fonts[Font].fdprivateOffsets[FD]); // While in the same object: while (getPosition() < fonts[Font].fdprivateOffsets[FD] + fonts[Font].fdprivateLengths[FD]) { getDictItem(); // If the dictItem is the "Subrs" then find and store offset, if ("Subrs".equals(key)) fonts[Font].PrivateSubrsOffset[FD] = (int) ((Integer) args[0]) + fonts[Font].fdprivateOffsets[FD]; } //Read the lsubr index if the lsubr was found if (fonts[Font].PrivateSubrsOffset[FD] >= 0) fonts[Font].PrivateSubrsOffsetsArray[FD] = getIndex(fonts[Font].PrivateSubrsOffset[FD]); }
/** * The function finds for the FD array processed the local subr offset and its * offset array. * * @param Font the font * @param FD The FDARRAY processed */ protected void BuildFDSubrsOffsets(int Font, int FD) { // Initiate to -1 to indicate lsubr operator present fonts[Font].PrivateSubrsOffset[FD] = -1; // Goto beginning of objects seek(fonts[Font].fdprivateOffsets[FD]); // While in the same object: while (getPosition() < fonts[Font].fdprivateOffsets[FD] + fonts[Font].fdprivateLengths[FD]) { getDictItem(); // If the dictItem is the "Subrs" then find and store offset, if ("Subrs".equals(key)) fonts[Font].PrivateSubrsOffset[FD] = (int) ((Integer) args[0]) + fonts[Font].fdprivateOffsets[FD]; } //Read the lsubr index if the lsubr was found if (fonts[Font].PrivateSubrsOffset[FD] >= 0) fonts[Font].PrivateSubrsOffsetsArray[FD] = getIndex(fonts[Font].PrivateSubrsOffset[FD]); }
/** * The function creates a private dict for a font that was not CID * All the keys are copied as is except for the subrs key * * @param Font the font * @param Subr The OffsetItem for the subrs of the private */ void CreateNonCIDPrivate(int Font, OffsetItem Subr) { // Go to the beginning of the private dict and read until the end seek(fonts[Font].privateOffset); while (getPosition() < fonts[Font].privateOffset + fonts[Font].privateLength) { int p1 = getPosition(); getDictItem(); int p2 = getPosition(); // If the dictItem is the "Subrs" then, // use marker for offset and write operator number if ("Subrs".equals(key)) { OutputList.addLast(Subr); OutputList.addLast(new UInt8Item((char) 19)); // Subrs } // Else copy the entire range else OutputList.addLast(new RangeItem(buf, p1, p2 - p1)); } }
/** * The function creates a private dict for a font that was not CID * All the keys are copied as is except for the subrs key * * @param Font the font * @param Subr The OffsetItem for the subrs of the private */ void CreateNonCIDPrivate(int Font, OffsetItem Subr) { // Go to the beginning of the private dict and read until the end seek(fonts[Font].privateOffset); while (getPosition() < fonts[Font].privateOffset + fonts[Font].privateLength) { int p1 = getPosition(); getDictItem(); int p2 = getPosition(); // If the dictItem is the "Subrs" then, // use marker for offset and write operator number if ("Subrs".equals(key)) { OutputList.addLast(Subr); OutputList.addLast(new UInt8Item((char) 19)); // Subrs } // Else copy the entire range else OutputList.addLast(new RangeItem(buf, p1, p2 - p1)); } }
/** * Calculates how many byte it took to write the offset for the subrs in a specific * private dict. * * @param Offset The Offset for the private dict * @param Size The size of the private dict * @return The size of the offset of the subrs in the private dict */ int CalcSubrOffsetSize(int Offset, int Size) { // Set the size to 0 int OffsetSize = 0; // Go to the beginning of the private dict seek(Offset); // Go until the end of the private dict while (getPosition() < Offset + Size) { int p1 = getPosition(); getDictItem(); int p2 = getPosition(); // When reached to the subrs offset if ("Subrs".equals(key)) { // The Offsize (minus the subrs key) OffsetSize = p2 - p1 - 1; } // All other keys are ignored } // return the size return OffsetSize; }
/** * Calculates how many byte it took to write the offset for the subrs in a specific * private dict. * * @param Offset The Offset for the private dict * @param Size The size of the private dict * @return The size of the offset of the subrs in the private dict */ int CalcSubrOffsetSize(int Offset, int Size) { // Set the size to 0 int OffsetSize = 0; // Go to the beginning of the private dict seek(Offset); // Go until the end of the private dict while (getPosition() < Offset + Size) { int p1 = getPosition(); getDictItem(); int p2 = getPosition(); // When reached to the subrs offset if ("Subrs".equals(key)) { // The Offsize (minus the subrs key) OffsetSize = p2 - p1 - 1; } // All other keys are ignored } // return the size return OffsetSize; }
while (getPosition() < fonts[Font].fdprivateOffsets[i] + fonts[Font].fdprivateLengths[i]) { int p1 = getPosition(); getDictItem(); int p2 = getPosition();
while (getPosition() < fonts[Font].fdprivateOffsets[i] + fonts[Font].fdprivateLengths[i]) { int p1 = getPosition(); getDictItem(); int p2 = getPosition();
while (getPosition() < fonts[Font].FDArrayOffsets[k + 1]) { int p1 = getPosition(); getDictItem(); int p2 = getPosition();
while (getPosition() < fonts[Font].FDArrayOffsets[k + 1]) { int p1 = getPosition(); getDictItem(); int p2 = getPosition();
getDictItem(); int p2 = getPosition();
getDictItem(); int p2 = getPosition();