Package org.apache.fop.complexscripts.fonts

Examples of org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable$ContextualSubtableFormat2


            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 );
View Full Code Here


                    gpos = new GlyphPositioningTable ( gdef, extractLookups(), subtables );
                }
                clearTable();
            } else if ( en[1].equals ( "GSUB" ) ) {
                if ( subtables.size() > 0 ) {
                    gsub = new GlyphSubstitutionTable ( gdef, extractLookups(), subtables );
                }
                clearTable();
            } else if ( en[1].equals ( "GlyphClassDef" ) ) {
                GlyphMappingTable mapping = extractClassDefMapping ( glyphClasses, stFormat, true );
                addGDEFSubtable ( GlyphDefinitionTable.GDEF_LOOKUP_TYPE_GLYPH_CLASS, mapping );
View Full Code Here

        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 ) ) {
                    assertSameAdjustments ( paa, tpaa, wf, tfn );
                } else if ( paa != null ) {
View Full Code Here

    }

    private static List compile ( String script, String language, String spn, String tfn, TTXFile tf ) {
        List<Object[]> data = new ArrayList<Object[]>();
        data.add ( new Object[] { script, language, spn, tfn } );
        GlyphSubstitutionTable gsub = tf.getGSUB();
        GlyphPositioningTable gpos = tf.getGPOS();
        int[] widths = tf.getWidths();
        if ( ( gsub != null ) && ( gpos != null ) ) {
            FileInputStream fis = null;
            try {
                fis = new FileInputStream ( spn );
                if ( fis != null ) {
                    LineNumberReader lr = new LineNumberReader ( new InputStreamReader ( fis, Charset.forName ( "UTF-8" ) ) );
                    String wf;
                    while ( ( wf = lr.readLine() ) != null ) {
                        GlyphSequence igs = tf.mapCharsToGlyphs ( wf );
                        GlyphSequence ogs = gsub.substitute ( igs, script, language );
                        int[][] paa = new int [ ogs.getGlyphCount() ] [ 4 ];
                        if ( ! gpos.position ( ogs, script, language, 1000, widths, paa ) ) {
                            paa = null;
                        }
                        data.add ( new Object[] { wf, getGlyphs ( igs ), getGlyphs ( ogs ), paa } );
View Full Code Here

TOP

Related Classes of org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable$ContextualSubtableFormat2

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.