Example #1
0
        public bool IsLookupCovered( 
                        FontTable table,
                        uint[] glyphBits,
                        ushort minGlyphId,
                        ushort maxGlyphId) 
        {
            switch (Format(table)) 
            { 
                case 1:
                    GlyphChainingSubtable glyphChainingSubtable = 
                                                new GlyphChainingSubtable(offset);
                    return glyphChainingSubtable.IsLookupCovered(table, glyphBits, minGlyphId, maxGlyphId);

                case 2: 

                    ClassChainingSubtable classChainingSubtable = 
                                                new ClassChainingSubtable(offset); 
                    return classChainingSubtable.IsLookupCovered(table, glyphBits, minGlyphId, maxGlyphId);
 
                case 3:

                    CoverageChainingSubtable coverageChainingSubtable =
                                    new CoverageChainingSubtable(table, offset); 

                    return coverageChainingSubtable.IsLookupCovered(table, glyphBits, minGlyphId, maxGlyphId); 
 

                default: 

                    return true;
            }
 
        }
Example #2
0
        public CoverageTable GetPrimaryCoverage(FontTable table) 
        {
            switch (Format(table)) 
            {
                case 1:
                    GlyphChainingSubtable glyphChainingSubtable =
                                                new GlyphChainingSubtable(offset); 
                    return glyphChainingSubtable.GetPrimaryCoverage(table);
 
                case 2: 

                    ClassChainingSubtable classChainingSubtable = 
                                                new ClassChainingSubtable(offset);
                    return classChainingSubtable.GetPrimaryCoverage(table);

                case 3: 

                    CoverageChainingSubtable coverageChainingSubtable = 
                                    new CoverageChainingSubtable(table, offset); 
                    return coverageChainingSubtable.GetPrimaryCoverage(table);
 

                default:
                    return CoverageTable.InvalidCoverage;
            } 
        }
Example #3
0
        public unsafe bool Apply(
            IOpenTypeFont           Font,           // Font access interface 
            OpenTypeTags            TableTag,       // Layout table tag (GSUB or GPOS)
            FontTable               Table,          // Layout table (GSUB or GPOS)
            LayoutMetrics           Metrics,        // LayoutMetrics
            int                     CharCount,      // Characters count (i.e. Charmap.Length); 
            UshortList              Charmap,        // Char to glyph mapping
            GlyphInfoList           GlyphInfo,      // List of GlyphInfo structs 
            int*                    Advances,       // Glyph adv.widths 
            LayoutOffset*           Offsets,        // Glyph offsets
            ushort                  LookupFlags,    // Lookup table flags 
            int                     FirstGlyph,     // where to apply it
            int                     AfterLastGlyph, // how long is a context we can use
            uint                    Parameter,      // lookup parameter
            int                     nestingLevel,   // Contextual lookup nesting level 
            out int                 NextGlyph       // out: next glyph index
            ) 
        { 
            NextGlyph = FirstGlyph+1; //In case we don't match
 
            switch (Format(Table))
            {
                case 1:
                    GlyphChainingSubtable glyphChainingSubtable = 
                        new GlyphChainingSubtable(offset);
                    return glyphChainingSubtable.Apply( 
                        Font, TableTag, Table, Metrics, 
                        CharCount, Charmap,
                        GlyphInfo, Advances, Offsets, 
                        LookupFlags, FirstGlyph, AfterLastGlyph,
                        Parameter,
                        nestingLevel,
                        out NextGlyph 
                        );
                case 2: 
                    ClassChainingSubtable classChainingSubtable = 
                        new ClassChainingSubtable(offset);
                    return classChainingSubtable.Apply( 
                        Font, TableTag, Table, Metrics,
                        CharCount, Charmap,
                        GlyphInfo, Advances, Offsets,
                        LookupFlags, FirstGlyph, AfterLastGlyph, 
                        Parameter,
                        nestingLevel, 
                        out NextGlyph 
                        );
                case 3: 
                    CoverageChainingSubtable coverageChainingSubtable =
                                    new CoverageChainingSubtable(Table, offset);
                    return coverageChainingSubtable.Apply(
                                            Font, TableTag, Table, Metrics, 
                                            CharCount, Charmap,
                                            GlyphInfo, Advances, Offsets, 
                                            LookupFlags, FirstGlyph, AfterLastGlyph, 
                                            Parameter,
                                            nestingLevel, 
                                            out NextGlyph
                                         );
                default:
                    //Unknown format 
                    return false;
            } 
        }