Package com.adobe.dp.css

Examples of com.adobe.dp.css.FontFaceRule


  public SelectorRule getRuleForSelector(Selector selector, boolean create) {
    return css.getRuleForSelector(selector, create);
  }

  public FontFaceRule createFontFace(FontResource fontResource) {
    FontFaceRule fontFace = new FontFaceRule();
    css.add(fontFace);
    fontFace.set("src", new ResourceURL(owner, fontResource.getResourceRef()));
    return fontFace;
  }
View Full Code Here


          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) {
        case FontPropertyConstants.WEIGHT_NORMAL:
          face.set("font-weight", new CSSName("normal"));
          break;
        case FontPropertyConstants.WEIGHT_BOLD:
          face.set("font-weight", new CSSName("bold"));
          break;
        default:
          face.set("font-weight", new CSSNumber(new Integer(entry.weight)));
          break;
        }
        switch (entry.style) {
        case FontPropertyConstants.STYLE_ITALIC:
          face.set("font-style", new CSSName("italic"));
          break;
        case FontPropertyConstants.STYLE_OBLIQUE:
          face.set("font-style", new CSSName("oblique"));
          break;
        default:
          face.set("font-style", new CSSName("normal"));
          break;
        }

      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.adobe.dp.css.FontFaceRule

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.