Examples of GlyphPositioningTable


Examples of org.apache.fop.complexscripts.fonts.GlyphPositioningTable

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

Examples of org.apache.fop.complexscripts.fonts.GlyphPositioningTable

                    gdef = new GlyphDefinitionTable ( subtables );
                }
                clearTable();
            } else if ( en[1].equals ( "GPOS" ) ) {
                if ( subtables.size() > 0 ) {
                    gpos = new GlyphPositioningTable ( gdef, extractLookups(), subtables );
                }
                clearTable();
            } else if ( en[1].equals ( "GSUB" ) ) {
                if ( subtables.size() > 0 ) {
                    gsub = new GlyphSubstitutionTable ( gdef, extractLookups(), subtables );
View Full Code Here

Examples of org.apache.fop.complexscripts.fonts.GlyphPositioningTable

        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 ) {
                    assertEquals ( "unequal adjustment count, word form(" + wf + "), font (" + tfn + ")", paa.length, 0 );
                }
            }
View Full Code Here

Examples of org.apache.fop.complexscripts.fonts.GlyphPositioningTable

    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 } );
                    }
                    lr.close();
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.