Examples of Type1MetricHelper


Examples of org.apache.padaf.preflight.font.Type1MetricHelper

        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 278 };
    InputStream font = this.getClass().getResourceAsStream(
        "subset_type1_valid.font");

    Type1MetricHelper helper = new Type1MetricHelper(font, length1, length2,
        FONT_DICTIONARY_VALUE_ENCODING_WIN);
    helper.parse();
    for (int i = 0; i < (last - first + 1); ++i) {
      if (widths[i] != 0) {
        assertTrue(widths[i] == helper.getWidth(first + i));
      }
    }

  }
View Full Code Here

Examples of org.apache.padaf.preflight.font.Type1MetricHelper

  public void testInvalidFont() throws Exception {
    int length1 = 926;
    int length2 = 12270;

    InputStream font = this.getClass().getResourceAsStream("true_type.ttf");
    Type1MetricHelper helper = new Type1MetricHelper(font, length1, length2,
        FONT_DICTIONARY_VALUE_ENCODING_WIN);

    helper.parse();
    fail();
  }
View Full Code Here

Examples of org.apache.padaf.preflight.font.Type1MetricHelper

        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 278 };
    InputStream font = this.getClass().getResourceAsStream(
        "subset_type1_valid.font");

  Type1MetricHelper helper = new Type1MetricHelper(font, length1, length2,
        FONT_DICTIONARY_VALUE_ENCODING_WIN);
    helper.parse();

    for (int i = 0; i < (last - first + 1); ++i) {
      if (widths[i] != 0) {
      System.out.println(widths[i] + " " + helper.getWidth(first + i));
        assertTrue(widths[i] == helper.getWidth(first + i));
      }
    }

    // ---- Missing Glyph returns notdef width 278 in the tested font
    assertTrue(helper.getWidth(200) == 278);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.