Exemplo n.º 1
0
 public bool IsLookupCovered(
                 FontTable table, 
                 uint[] glyphBits, 
                 ushort minGlyphId,
                 ushort maxGlyphId) 
 {
     switch (Format(table))
     {
         case 1: 
             GlyphContextSubtable glyphContextSubtable =
                                         new GlyphContextSubtable(offset); 
             return glyphContextSubtable.IsLookupCovered(table, glyphBits, minGlyphId, maxGlyphId); 
         case 2:
             ClassContextSubtable classContextSubtable = 
                                         new ClassContextSubtable(offset);
             return classContextSubtable.IsLookupCovered(table, glyphBits, minGlyphId, maxGlyphId);
         case 3:
             CoverageContextSubtable coverageContextSubtable = 
                                         new CoverageContextSubtable(offset);
             return coverageContextSubtable.IsLookupCovered(table, glyphBits, minGlyphId, maxGlyphId); 
         default: 
             return true;
     } 
 }
Exemplo n.º 2
0
        public CoverageTable GetPrimaryCoverage(FontTable table)
        { 
            switch (Format(table))
            { 
                case 1: 
                    GlyphContextSubtable glyphContextSubtable =
                                                new GlyphContextSubtable(offset); 
                    return glyphContextSubtable.GetPrimaryCoverage(table);
                case 2:
                    ClassContextSubtable classContextSubtable =
                                                new ClassContextSubtable(offset); 
                    return classContextSubtable.GetPrimaryCoverage(table);
                case 3: 
                    CoverageContextSubtable coverageContextSubtable = 
                                                new CoverageContextSubtable(offset);
                    return coverageContextSubtable.GetPrimaryCoverage(table); 

                default:
                    return CoverageTable.InvalidCoverage;
            } 
        }
Exemplo n.º 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
     )
 { 
     switch (Format(Table))
     { 
         case 1: 
             GlyphContextSubtable glyphContextSubtable =
                                         new GlyphContextSubtable(offset); 
             return glyphContextSubtable.Apply(
                 Font, TableTag, Table, Metrics,
                 CharCount, Charmap,
                 GlyphInfo, Advances, Offsets, 
                 LookupFlags, FirstGlyph, AfterLastGlyph,
                 Parameter, 
                 nestingLevel, 
                 out NextGlyph
                 ); 
         case 2:
             ClassContextSubtable classContextSubtable =
                                         new ClassContextSubtable(offset);
             return classContextSubtable.Apply( 
                 Font, TableTag, Table, Metrics,
                 CharCount, Charmap, 
                 GlyphInfo, Advances, Offsets, 
                 LookupFlags, FirstGlyph, AfterLastGlyph,
                 Parameter, 
                 nestingLevel,
                 out NextGlyph
                 );
         case 3: 
             CoverageContextSubtable coverageContextSubtable =
                                         new CoverageContextSubtable(offset); 
             return coverageContextSubtable.Apply( 
                 Font, TableTag, Table, Metrics,
                 CharCount, Charmap, 
                 GlyphInfo, Advances, Offsets,
                 LookupFlags, FirstGlyph, AfterLastGlyph,
                 Parameter,
                 nestingLevel, 
                 out NextGlyph
                 ); 
         default: 
             //Unknown format
             NextGlyph = FirstGlyph+1; //don't match 
             return false;
     }
 }