Package org.apache.fop.complexscripts.fonts.ttx

Examples of org.apache.fop.complexscripts.fonts.ttx.TTXFile$Handler


    private void performLookups ( Object[] tp, Object[] td ) {
        assert tp.length > 0;
        if ( td.length > 1 ) {
            String fid = (String) td[0];
            String lid = (String) td[1];
            TTXFile tf = findTTX ( fid );
            assertTrue ( tf != null );
            GlyphDefinitionTable gdef = tf.getGDEF();
            assertTrue ( gdef != null );
            String[][] tia = (String[][]) td[2];
            switch ( (int) ( (Integer) tp[0] ) ) {
            case GlyphDefinitionTable.GDEF_LOOKUP_TYPE_GLYPH_CLASS:
                performGlyphClassLookups ( tf, lid, tia );
View Full Code Here


    private TTXFile findTTX ( String fid ) {
        String pn = findTTXPath ( fid );
        assertTrue ( pn != null );
        try {
            TTXFile tf = TTXFile.getFromCache ( pn );
            return tf;
        } catch ( Exception e ) {
            fail ( e.getMessage() );
            return null;
        }
View Full Code Here

            String fid = (String) td[0];
            String lid = (String) td[1];
            String script = (String) td[2];
            String language = (String) td[3];
            String feature = (String) td[4];
            TTXFile tf = findTTX ( fid );
            assertTrue ( tf != null );
            GlyphSubstitutionTable gsub = tf.getGSUB();
            assertTrue ( gsub != null );
            GlyphSubstitutionSubtable[] sta = findGSUBSubtables ( gsub, script, language, feature, lid );
            assertTrue ( sta != null );
            assertTrue ( sta.length > 0 );
            ScriptContextTester sct = findScriptContextTester ( script, language, feature );
            String[][][] tia = (String[][][]) td[5];            // test instance array
            for ( String[][] ti : tia ) {                       // test instance
                if ( ti != null ) {
                    if ( ti.length > 1 ) {                      // must have at least input and output glyph id arrays
                        String[] igia = ti[0];                  // input glyph id array
                        String[] ogia = ti[1];                  // output glyph id array
                        GlyphSequence igs = tf.getGlyphSequence ( igia );
                        GlyphSequence ogs = tf.getGlyphSequence ( ogia );
                        GlyphSequence tgs = GlyphSubstitutionSubtable.substitute ( igs, script, language, feature, sta, sct );
                        assertSameGlyphs ( ogs, tgs );
                    }
                }
            }
View Full Code Here

    private TTXFile findTTX ( String fid ) {
        String pn = findTTXPath ( fid );
        assertTrue ( pn != null );
        try {
            TTXFile tf = TTXFile.getFromCache ( pn );
            return tf;
        } catch ( Exception e ) {
            fail ( e.getMessage() );
            return null;
        }
View Full Code Here

            String fid = (String) td[0];
            String lid = (String) td[1];
            String script = (String) td[2];
            String language = (String) td[3];
            String feature = (String) td[4];
            TTXFile tf = findTTX ( fid );
            assertTrue ( tf != null );
            GlyphPositioningTable gpos = tf.getGPOS();
            assertTrue ( gpos != null );
            GlyphPositioningSubtable[] sta = findGPOSSubtables ( gpos, script, language, feature, lid );
            assertTrue ( sta != null );
            assertTrue ( sta.length > 0 );
            ScriptContextTester sct = findScriptContextTester ( script, language, feature );
            Object[][] tia = (Object[][]) td[5];                // test instance array
            for ( Object[] ti : tia ) {                         // test instance
                if ( ti != null ) {
                    if ( ti.length > 0 ) {                      // must have at least input glyphs
                        String[] igia = (String[]) ti[0];       // input glyph id array
                        int[][] ogpa = (int[][]) ti[1];         // output glyph positioning array
                        GlyphSequence igs = tf.getGlyphSequence ( igia );
                        int[] widths = tf.getWidths();
                        int[][] tgpa = new int [ igia.length ] [ 4 ];
                        boolean adjusted = GlyphPositioningSubtable.position ( igs, script, language, feature, 1000, sta, widths, tgpa, sct );
                        assertTrue ( adjusted );
                        assertSamePositions ( ogpa, tgpa );
                    }
View Full Code Here

    private TTXFile findTTX ( String fid ) {
        String pn = findTTXPath ( fid );
        assertTrue ( pn != null );
        try {
            TTXFile tf = TTXFile.getFromCache ( pn );
            return tf;
        } catch ( Exception e ) {
            fail ( e.getMessage() );
            return null;
        }
View Full Code Here

        assert data != null;
        assert data.size() > 0;
        String script = null;
        String language = null;
        String tfn = null;
        TTXFile tf = null;
        GlyphSubstitutionTable gsub = null;
        GlyphPositioningTable gpos = null;
        int[] widths = null;
        for ( Object[] d : data ) {
            if ( script == null ) {
                assert d.length >= 4;
                script = (String) d[0];
                language = (String) d[1];
                tfn = (String) d[3];
                tf = TTXFile.getFromCache ( ttxFontsDir + File.separator + tfn );
                assertTrue ( tf != null );
                gsub = tf.getGSUB();
                assertTrue ( gsub != null );
                gpos = tf.getGPOS();
                assertTrue ( gpos != null );
                widths = tf.getWidths();
                assertTrue ( widths != null );
            } else {
                assert tf != null;
                assert gsub != null;
                assert gpos != null;
                assert tfn != null;
                assert d.length >= 4;
                String wf = (String) d[0];
                int[] iga = (int[]) d[1];
                int[] oga = (int[]) d[2];
                int[][] paa = (int[][]) d[3];
                GlyphSequence tigs = tf.mapCharsToGlyphs ( wf );
                assertSameGlyphs ( iga, getGlyphs ( tigs ), "input glyphs", wf, tfn );
                GlyphSequence togs = gsub.substitute ( tigs, script, language );
                assertSameGlyphs ( oga, getGlyphs ( togs ), "output glyphs", wf, tfn );
                int[][] tpaa = new int [ togs.getGlyphCount() ] [ 4 ];
                if ( gpos.position ( togs, script, language, 1000, widths, tpaa ) ) {
View Full Code Here

    }

    private static void compile ( String script, String language, String spn ) {
        int fno = 0;
        for ( String tfn : ttxFonts ) {
            TTXFile tf = TTXFile.getFromCache ( ttxFontsDir + File.separator + tfn );
            assert tf != null;
            List data = compile ( script, language, spn, tfn, tf );
            output ( makeDataPathName ( spn, fno++ ), data );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.complexscripts.fonts.ttx.TTXFile$Handler

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.