Examples of FontManager


Examples of bibliothek.gui.dock.util.font.FontManager

     * @param factory the factory for new bridges, can be <code>null</code>
     */
    public void putFontBridgeFactory( Path kind, FontBridgeFactory factory ){
        fontBridgeFactories.put( kind, factory );
        for( Controller setting : controllers ){
            FontManager fonts = setting.controller.getFonts();
           
            FontBridge oldBridge = setting.fonts.remove( kind );
            FontBridge newBridge = factory == null ? null : factory.create( fonts );
           
            if( newBridge == null ){
                setting.fonts.remove( kind );
               
                if( oldBridge != null ){
                    fonts.unpublish( Priority.DEFAULT, kind );
                }
            }
            else{
                setting.fonts.put( kind, newBridge );
                fonts.publish( Priority.DEFAULT, kind, newBridge );
            }
        }
    }
View Full Code Here

Examples of bibliothek.gui.dock.util.font.FontManager

        }
        finally{
            colors.unlockUpdate();
        }
       
        FontManager fonts = controller.getFonts();
        try{
            fonts.lockUpdate();
            for( Map.Entry<Path, FontBridgeFactory> entry : fontBridgeFactories.entrySet() ){
                FontBridge bridge = entry.getValue().create( fonts );
                fonts.publish( Priority.DEFAULT, entry.getKey(), bridge );
                settings.fonts.put( entry.getKey(), bridge );
            }
        }
        finally{
            fonts.unlockUpdate();
        }
       
        controllers.add( settings );
    }
View Full Code Here

Examples of bibliothek.gui.dock.util.font.FontManager

                ColorManager colors = controller.getColors();
                for( ColorBridge bridge : settings.colors.values() ){
                    colors.unpublish( Priority.DEFAULT, bridge );
                }
               
                FontManager fonts = controller.getFonts();
                for( FontBridge bridge : settings.fonts.values() ){
                    fonts.unpublish( Priority.DEFAULT, bridge );
                }
            }
        }
       
        for( DockThemeExtension extension : extensions ){
View Full Code Here

Examples of flash.fonts.FontManager

        implicitIncludes.add(cssFile);
        InputStream cssFileStream = null;

        try
        {
            FontManager fontManager = mxmlConfiguration.getFontsConfiguration().getTopLevelManager();
            StyleSheet styleSheet = new StyleSheet();
            styleSheet.checkDeprecation(mxmlConfiguration.showDeprecationWarnings());
            cssFileStream = cssFile.getInputStream();
            styleSheet.parse(cssFile.getName(), cssFileStream, ThreadLocalToolkit.getLogger(), fontManager);
            extractStyles(styleSheet, false);
View Full Code Here

Examples of m33.util.FontManager

    framesPerSec = 0;

    gameState = MAIN_MENU;
    mainMenu = new MainMenu(SCREEN_W, SCREEN_H);

    fontManager = new FontManager();
   
    currentLevel = 1;
    generate = new GeneratingScreen(SCREEN_W, SCREEN_H, currentLevel);
    //generate.setLevel(currentLevel);
   
View Full Code Here

Examples of org.apache.fop.fonts.FontManager

     * @throws FOPException if an error occurs while processing the configuration
     */
    protected List/*<EmbedFontInfo>*/ buildFontList(Configuration cfg, FontResolver fontResolver,
                    FontEventListener listener) throws FOPException {
        FopFactory factory = userAgent.getFactory();
        FontManager fontManager = factory.getFontManager();
        if (fontResolver == null) {
            //Ensure that we have minimal font resolution capabilities
            fontResolver = FontManager.createMinimalFontResolver();
        }

View Full Code Here

Examples of org.apache.fop.fonts.FontManager

    }

    /** {@inheritDoc} */
    public void setupFontInfo(IFDocumentHandler documentHandler, FontInfo fontInfo)
                throws FOPException {
        FontManager fontManager = userAgent.getFactory().getFontManager();
        List fontCollections = new java.util.ArrayList();
        fontCollections.add(new Base14FontCollection(fontManager.isBase14KerningEnabled()));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new CustomFontCollection(fontResolver, fontList));
        }

        fontManager.setup(fontInfo,
                (FontCollection[])fontCollections.toArray(
                        new FontCollection[fontCollections.size()]));
        documentHandler.setFontInfo(fontInfo);
    }
View Full Code Here

Examples of org.apache.fop.fonts.FontManager

    }

    /** {@inheritDoc} */
    public void setupFontInfo(IFDocumentHandler documentHandler, FontInfo fontInfo)
            throws FOPException {
        FontManager fontManager = userAgent.getFactory().getFontManager();

        Graphics2D graphics2D = Java2DFontMetrics.createFontMetricsGraphics2D();

        List fontCollections = new java.util.ArrayList();
        fontCollections.add(new Base14FontCollection(graphics2D));
        fontCollections.add(new InstalledFontCollection(graphics2D));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new ConfiguredFontCollection(fontResolver, fontList));
        }

        fontManager.setup(fontInfo,
                (FontCollection[])fontCollections.toArray(
                        new FontCollection[fontCollections.size()]));
        documentHandler.setFontInfo(fontInfo);
    }
View Full Code Here

Examples of org.apache.fop.fonts.FontManager

    }

    private AFPFontInfo buildFont(Configuration fontCfg, String fontPath)
    throws ConfigurationException {

        FontManager fontManager = this.userAgent.getFactory().getFontManager();

        Configuration[] triple = fontCfg.getChildren("font-triplet");
        List/*<FontTriplet>*/ tripletList = new java.util.ArrayList/*<FontTriplet>*/();
        if (triple.length == 0) {
            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"));
            FontTriplet triplet = new FontTriplet(triple[j].getAttribute("name"),
                    triple[j].getAttribute("style"),
                    weight);
            tripletList.add(triplet);
        }

        //build the fonts
        Configuration afpFontCfg = fontCfg.getChild("afp-font");
        if (afpFontCfg == null) {
            log.error("Mandatory font configuration element '<afp-font...' is missing");
            return null;
        }

        URI baseURI = null;
        String uri = afpFontCfg.getAttribute("base-uri", fontPath);
        if (uri == null) {
            //Fallback for old attribute which only supports local filenames
            String path = afpFontCfg.getAttribute("path", fontPath);
            if (path != null) {
                File f = new File(path);
                baseURI = f.toURI();
            }
        } else {
            try {
                baseURI = new URI(uri);
            } catch (URISyntaxException e) {
                log.error("Invalid URI: " + e.getMessage());
                return null;
            }
        }
        ResourceAccessor accessor = new DefaultFOPResourceAccessor(
                this.userAgent,
                fontManager.getFontBaseURL(),
                baseURI);

        String type = afpFontCfg.getAttribute("type");
        if (type == null) {
            log.error("Mandatory afp-font configuration attribute 'type=' is missing");
View Full Code Here

Examples of org.apache.fop.fonts.FontManager

     */
    private List/*<AFPFontInfo>*/ buildFontListFromConfiguration(Configuration cfg)
    throws FOPException, ConfigurationException {

        Configuration fonts = cfg.getChild("fonts");
        FontManager fontManager = this.userAgent.getFactory().getFontManager();

        // General matcher
        FontTriplet.Matcher referencedFontsMatcher = fontManager.getReferencedFontsMatcher();
        // Renderer-specific matcher
        FontTriplet.Matcher localMatcher = null;

        // Renderer-specific referenced fonts
        Configuration referencedFontsCfg = fonts.getChild("referenced-fonts", false);
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.