Examples of FontTriplet


Examples of org.apache.fop.configuration.FontTriplet

                    fontInfo.addMetrics(internalName, font);
                   
                    Vector triplets = configFontInfo.getFontTriplets();
                    for (Enumeration t = triplets.elements();
                            t.hasMoreElements(); ) {
                        FontTriplet triplet = (FontTriplet)t.nextElement();

                        fontInfo.addFontProperties(internalName,
                                                   triplet.getName(),
                                                   triplet.getStyle(),
                                                   triplet.getWeight());
                    }
                }
            } catch (Exception ex) {
                MessageHandler.error("Failed to read font metrics file "
                                     + configFontInfo.getMetricsFile()
View Full Code Here

Examples of org.apache.fop.configuration.FontTriplet

                                                 configFontInfo.getKerning());
                    fontInfo.addMetrics(internalName, font);

                    List triplets = configFontInfo.getFontTriplets();
                    for (int j = 0; j < triplets.size(); j++) {
                        FontTriplet triplet = (FontTriplet)triplets.get(j);

                        fontInfo.addFontProperties(internalName,
                                                   triplet.getName(),
                                                   triplet.getStyle(),
                                                   triplet.getWeight());
                    }
                }
            } catch (Exception ex) {
                MessageHandler.error("Failed to read a font metrics file: "
                                      + ex.getMessage());
View Full Code Here

Examples of org.apache.fop.configuration.FontTriplet

                    internalName = "F" + num;
                    num++;

                    List triplets = configFontInfo.getFontTriplets();
                    for (int j = 0; j < triplets.size(); j++) {
                        FontTriplet triplet = (FontTriplet)triplets.get(j);
                        boolean embed = configFontInfo.getEmbedFile() != null;
                        // if embed font is not specified, use system "Dialog"
                        // logical font name for each Locale.
                        String family = embed ? triplet.getName() : "Dialog";
                        metric = new FontMetricsMapper(family,
                                                       getFontMetrics(triplet),
                                                       graphics);
                        if (embed)
                            metric.setEmbedFont(configFontInfo.getEmbedFile());
                        fontInfo.addMetrics(internalName, metric);
                        fontInfo.addFontProperties(internalName,
                                                   triplet.getName(),
                                                   triplet.getStyle(),
                                                   triplet.getWeight());
                    }
                }
            } catch (Exception ex) {
                MessageHandler.error("Failed to read font metrics file: "
                                     + ex.getMessage());
View Full Code Here

Examples of org.apache.fop.configuration.FontTriplet

                reader.setFontEmbedPath(configFontInfo.getEmbedFile());
                fontInfo.addMetrics(internalName, reader.getFont());
               
                Vector triplets = configFontInfo.getFontTriplets();
                for (Enumeration t = triplets.elements(); t.hasMoreElements();) {
                    FontTriplet triplet = (FontTriplet)t.nextElement();
                   
                    fontInfo.addFontProperties(internalName,
                                               triplet.getName(),
                                               triplet.getStyle(),
                                               triplet.getWeight());
                }
            }
        } catch (Exception ex) {
            MessageHandler.error("Failed to read font metrics file " +
                                 configFontInfo.getMetricsFile() +
View Full Code Here

Examples of org.apache.fop.fonts.FontTriplet

                    PROXY_PAINTER.paint(node, g2d);
                    return;
                }
                fontFamily = fam.getFamilyName();
                if (fi.hasFont(fontFamily, style, weight)) {
                    FontTriplet triplet = fontInfo.fontLookup(fontFamily, style,
                                                       weight);
                    int fsize = (int)(size.floatValue() * 1000);
                    fontState = fontInfo.getFontInstance(triplet, fsize);
                    found = true;
                    break;
                }
            }
        }
        if (!found) {
            FontTriplet triplet = fontInfo.fontLookup("any", style, Font.WEIGHT_NORMAL);
            int fsize = (int)(size.floatValue() * 1000);
            fontState = fontInfo.getFontInstance(triplet, fsize);
        } else {
            if (g2d instanceof PDFGraphics2D) {
                ((PDFGraphics2D) g2d).setOverrideFontState(fontState);
View Full Code Here

Examples of org.apache.fop.fonts.FontTriplet

            log.error("Mandatory font configuration element '<font-triplet...' is missing");
            return null;
        }
        for (int j = 0; j < triple.length; j++) {
            int weight = FontUtil.parseCSS2FontWeight(triple[j].getAttribute("weight"));
            tripleList.add(new FontTriplet(triple[j].getAttribute("name"),
                                           triple[j].getAttribute("style"),
                                           weight));
        }

        //build the fonts
View Full Code Here

Examples of org.apache.fop.fonts.FontTriplet

            AFPFontInfo afi = buildFont(font[i], null);
            if (afi != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Adding font " + afi.getAFPFont().getFontName());
                    for (int j = 0; j < afi.getFontTriplets().size(); ++j) {
                        FontTriplet triplet = (FontTriplet) afi.getFontTriplets().get(j);
                        log.debug("  Font triplet "
                                  + triplet.getName() + ", "
                                  + triplet.getStyle() + ", "
                                  + triplet.getWeight());
                    }
                }

                fontList.add(afi);
            }
View Full Code Here

Examples of org.apache.fop.fonts.FontTriplet

                n = "sans-serif";
            }
            float siz = gFont.getSize2D();
            String style = gFont.isItalic() ? "italic" : "normal";
            int weight = gFont.isBold() ? Font.WEIGHT_BOLD : Font.WEIGHT_NORMAL;
            FontTriplet triplet = fontInfo.fontLookup(n, style, weight);
            fontState = fontInfo.getFontInstance(triplet, (int)(siz * 1000 + 0.5));
        } else {
            fontState = fontInfo.getFontInstance(
                    ovFontState.getFontTriplet(), ovFontState.getFontSize());
            ovFontState = null;
View Full Code Here

Examples of org.apache.fop.fonts.FontTriplet

     * Returns the internal font key fot a font triplet coming from the area tree
     * @param area the area from which to retrieve the font triplet information
     * @return the internal font key (F1, F2 etc.) or null if not found
     */
    protected String getInternalFontNameForArea(Area area) {
        FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
        return fontInfo.getInternalFontKey(triplet);
    }
View Full Code Here

Examples of org.apache.fop.fonts.FontTriplet

     * Returns a Font object constructed based on the font traits in an area
     * @param area the area from which to retrieve the font triplet information
     * @return the requested Font instance or null if not found
     */
    protected Font getFontFromArea(Area area) {
        FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
        int size = ((Integer)area.getTrait(Trait.FONT_SIZE)).intValue();
        return fontInfo.getFontInstance(triplet, size);
    }
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.