コード例 #1
0
  /** @see de.dante.extex.font.type.PlFormat#toPL( de.dante.extex.font.type.PlWriter) */
  public void toPL(final PlWriter out) throws IOException {

    if (boundaryChar != TfmCharInfoWord.NOCHARCODE) {
      out.plopen("BOUNDARYCHAR").addChar(boundaryChar).plclose();
    }
    if (ligKernTable.length > 0) {
      out.plopen("LIGTABLE");
      for (int i = 0; i < charinfo.getCharinfoword().length; i++) {
        TfmCharInfoWord ciw = charinfo.getCharinfoword()[i];
        if (ciw != null) {
          if (foundLigKern(ciw)) {
            out.plopen("LABEL").addChar((short) (i + bc));
            out.plclose();

            // ligature
            int ligstart = ciw.getLigkernstart();
            if (ligstart != TfmCharInfoWord.NOINDEX && ligKernTable != null) {

              for (int k = ligstart;
                  k != TfmCharInfoWord.NOINDEX;
                  k = ligKernTable[k].nextIndex(k)) {
                TfmLigKern lk = ligKernTable[k];

                if (lk instanceof TfmLigature) {
                  TfmLigature lig = (TfmLigature) lk;

                  out.plopen("LIG")
                      .addChar(lig.getNextChar())
                      .addChar(lig.getAddingChar())
                      .plclose();
                } else if (lk instanceof TfmKerning) {
                  TfmKerning kerning = (TfmKerning) lk;

                  out.plopen("KRN")
                      .addChar(kerning.getNextChar())
                      .addReal(kerning.getKern())
                      .plclose();
                }
              }
            }
            out.plopen("STOP").plclose();
          }
        }
      }
      out.plclose();
    }
  }
コード例 #2
0
  /**
   * Records the starting indexes of final lig/kern program in ligKernTable to auxiliary character
   * information field <code>ligkernstart</code> of <code>AuxCharInfo</code>.
   *
   * @param pos the position of currently processed instruction in original tfm lig/kern table
   *     <code>ligAuxTab</code>.
   * @param start the position of corresponding instruction in final lig/kern table LigKernTable.
   */
  private void setLigStarts(final int pos, final int start) {

    TfmIndexMultimap.Enum lab = labels.forKey(pos);
    while (lab.hasMore()) {
      int c = lab.next();
      if (c == BOUNDARYLABEL) {
        boundaryStart = start;
      } else {
        charinfo.getCharinfoword()[c].setLigkernstart(start);
      }
    }
  }
コード例 #3
0
  /**
   * Builds associative table labels which maps the character codes to lig/kern program starting
   * indexes in ligAuxTab for remapping later. It also marks the starting instructions of lig/kern
   * programs as active (using the <code>activity</code> field of LigKern). TFtoPL[67]
   */
  private void buildLabels() {

    TfmCharInfoWord[] ciw = charinfo.getCharinfoword();

    for (int i = 0; i < ciw.length; i++) {
      if (ciw[i].getTag() == TfmCharInfoWord.LIG_TAG) {
        int start = ligStart(ciw[i].getRemainder());
        if (start < ligkerncommand.length) {
          labels.add(start, i);
          ligkerncommand[start].setActivity(TfmLigKernCommand.ACCESSIBLE);
        } else {
          ciw[i].resetTag();
        }
      }
    }
  }