Package com.adobe.dp.epub.io

Examples of com.adobe.dp.epub.io.BufferedDataSource


    Enumeration list = subsetters.keys();
    while (list.hasMoreElements()) {
      FontEntry entry = (FontEntry) list.nextElement();
      if (!entry.subsetter.used)
        continue;
      BufferedDataSource bds = new BufferedDataSource();
      try {
        OpenTypeFont font = entry.subsetter.font;
        String resName = entry.familyName.replaceAll(" ", "-") + "-" + entry.weight;
        switch (entry.style) {
        case FontPropertyConstants.STYLE_ITALIC:
          resName += "-Italic";
          break;
        case FontPropertyConstants.STYLE_OBLIQUE:
          resName += "-Oblique";
          break;
        }
        String primaryUUID = epub.getPrimaryIdentifier();
        if (primaryUUID != null && primaryUUID.startsWith("urn:uuid:")) {
          resName = resName + "-" + primaryUUID.substring(9);
        }
        bds.getOutputStream().write(font.getSubsettedFont());
        String folder = epub.getContentFolder() == null ? "" : epub.getContentFolder() + "/";
        FontResource fontResource = epub.createFontResource(folder + "fonts/" + resName + ".otf", bds);
        FontFaceRule face = styleResource.getStylesheet().createFontFace(fontResource);
        face.set("font-family", new CSSQuotedString(entry.familyName));
        switch (entry.weight) {
View Full Code Here

TOP

Related Classes of com.adobe.dp.epub.io.BufferedDataSource

Copyright © 2018 www.massapicom. 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.