Examples of FontFaceRule


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

Examples of com.adobe.dp.css.FontFaceRule

          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

Examples of org.apache.batik.css.engine.FontFaceRule

        CSSEngine engine = ((SVGOMDocument)doc).getCSSEngine();
        List sms = engine.getFontFaces();
        Iterator iter = sms.iterator();
        while (iter.hasNext()) {
            FontFaceRule ffr = (FontFaceRule)iter.next();
            ret.add(CSSFontFace.createCSSFontFace(engine, ffr));
        }
        return ret;
    }
View Full Code Here

Examples of org.apache.batik.css.engine.FontFaceRule

        CSSEngine engine = ((SVGOMDocument)doc).getCSSEngine();
        List sms = engine.getFontFaces();
        Iterator iter = sms.iterator();
        while (iter.hasNext()) {
            FontFaceRule ffr = (FontFaceRule)iter.next();
            ret.add(CSSFontFace.createCSSFontFace(engine, ffr));
        }
        return ret;
    }
View Full Code Here

Examples of org.apache.batik.css.engine.FontFaceRule

        CSSEngine engine = ((SVGOMDocument)doc).getCSSEngine();
        List sms = engine.getFontFaces();
        Iterator iter = sms.iterator();
        while (iter.hasNext()) {
            FontFaceRule ffr = (FontFaceRule)iter.next();
            ret.add(CSSFontFace.createCSSFontFace(engine, ffr));
        }
        return ret;
    }
View Full Code Here

Examples of org.apache.flex.forks.batik.css.engine.FontFaceRule

        CSSEngine engine = ((SVGOMDocument)doc).getCSSEngine();
        List sms = engine.getFontFaces();
        Iterator iter = sms.iterator();
        while (iter.hasNext()) {
            FontFaceRule ffr = (FontFaceRule)iter.next();
            ret.add(CSSFontFace.createCSSFontFace(engine, ffr));
        }
        return ret;
    }
View Full Code Here

Examples of org.apache.flex.forks.batik.css.engine.FontFaceRule

        CSSEngine engine = ((SVGOMDocument)doc).getCSSEngine();
        List sms = engine.getFontFaces();
        Iterator iter = sms.iterator();
        while (iter.hasNext()) {
            FontFaceRule ffr = (FontFaceRule)iter.next();
            ret.add(CSSFontFace.createCSSFontFace(engine, ffr));
        }
        return ret;
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.FontFaceRule

//    ;
    private void font_face(Stylesheet stylesheet) throws IOException {
        //System.out.println("font_face()");
        Token t = next();
        try {
            FontFaceRule fontFaceRule = new FontFaceRule(stylesheet.getOrigin());
            if (t == Token.TK_FONT_FACE_SYM) {
                skip_whitespace();
               
                Ruleset ruleset = new Ruleset(stylesheet.getOrigin());
               
                skip_whitespace();
                t = next();
                if (t == Token.TK_LBRACE) {
                    LOOP:
                    while (true) {
                        skip_whitespace();
                        t = la();
                        if (t == Token.TK_RBRACE) {
                            next();
                            skip_whitespace();
                            break LOOP;
                        } else {
                            declaration_list(ruleset, false, true, true);
                        }
                    }
                } else {
                    push(t);
                    throw new CSSParseException(t, Token.TK_LBRACE, getCurrentLine());
                }
               
                fontFaceRule.addContent(ruleset);
                stylesheet.addFontFaceRule(fontFaceRule);
            } else {
                push(t);
                throw new CSSParseException(t, Token.TK_FONT_FACE_SYM, getCurrentLine());
            }
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.FontFaceRule

        }
    }

    public void importFontFaces(List fontFaces) {
        for (Iterator i = fontFaces.iterator(); i.hasNext(); ) {
            FontFaceRule rule = (FontFaceRule)i.next();
            CalculatedStyle style = rule.getCalculatedStyle();

            FSDerivedValue src = style.valueByName(CSSName.SRC);
            if (src == IdentValue.NONE) {
                continue;
            }

            byte[] font1 = _sharedContext.getUac().getBinaryResource(src.asString());
            if (font1 == null) {
                XRLog.exception("Could not load font " + src.asString());
                continue;
            }

            byte[] font2 = null;
            FSDerivedValue metricsSrc = style.valueByName(CSSName.FS_FONT_METRIC_SRC);
            if (metricsSrc != IdentValue.NONE) {
                font2 = _sharedContext.getUac().getBinaryResource(metricsSrc.asString());
                if (font2 == null) {
                    XRLog.exception("Could not load font metric data " + src.asString());
                    continue;
                }
            }

            if (font2 != null) {
                byte[] t = font1;
                font1 = font2;
                font2 = t;
            }

            boolean embedded = style.isIdent(CSSName.FS_PDF_FONT_EMBED, IdentValue.EMBED);

            String encoding = style.getStringProperty(CSSName.FS_PDF_FONT_ENCODING);

            String fontFamily = null;
            if (rule.hasFontFamily()) {
                fontFamily = style.valueByName(CSSName.FONT_FAMILY).asString();
            }
            try {
                addFontFaceFont(fontFamily, src.asString(), encoding, embedded, font1, font2);
            } catch (DocumentException e) {
View Full Code Here

Examples of org.xhtmlrenderer.css.sheet.FontFaceRule

        }
    }
   
    public void importFontFaces(List fontFaces) {
        for (Iterator i = fontFaces.iterator(); i.hasNext(); ) {
            FontFaceRule rule = (FontFaceRule)i.next();
            CalculatedStyle style = rule.getCalculatedStyle();
           
            FSDerivedValue src = style.valueByName(CSSName.SRC);
            if (src == IdentValue.NONE) {
                continue;
            }
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.