Beispiel #1
0
        public void DoSubstitution(IGlyphIndexList glyphIndexList)
        {
            // Rebuild tables if configuration changed
            if (_mustRebuildTables)
            {
                RebuildTables();
                _mustRebuildTables = false;
            }


            // Iterate over lookups, then over glyphs, as explained in the spec:
            // "During text processing, a client applies a lookup to each glyph
            // in the string before moving to the next lookup."
            // https://www.microsoft.com/typography/otspec/gsub.htm
            foreach (GSubLkContext lookupCtx in _lookupTables)
            {
                GSUB.LookupTable lookupTable = lookupCtx.lookup;
                lookupCtx.SetGlyphCount(glyphIndexList.Count);

                for (int pos = 0; pos < glyphIndexList.Count; ++pos)
                {
                    if (!lookupCtx.WillCheckThisGlyph(pos))
                    {
                        continue;
                    }
                    lookupTable.DoSubstitutionAt(glyphIndexList, pos, glyphIndexList.Count - pos);
                }
            }
        }
        public void DoSubstitution(IGlyphIndexList outputCodePoints)
        {
            if (lookupTables == null)
            {
                return;
            }                                     //early exit if no lookup tables

            //
            //load
            for (int pos = 0; pos < outputCodePoints.Count; ++pos)
            {
                bool hasChanged = false;
                foreach (GSUB.LookupTable lookupTable in lookupTables)
                {
                    if (!EnableLigation &&
                        lookupTable.ForUseWithFeatureId == Features.liga.shortname)
                    {
                        //skip this feature
                        continue;
                    }

                    if (lookupTable.DoSubstitutionAt(outputCodePoints, pos, outputCodePoints.Count - pos))
                    {
                        hasChanged = true;
                    }
                }

                if (!hasChanged)
                {
                    ++pos;
                }
            }
        }
        public void DoSubstitution(IGlyphIndexList outputCodePoints)
        {
            if (lookupTables == null)
            {
                return;
            }                                     //early exit if no lookup tables

            //
            //load
            int j = lookupTables.Count;

            for (int i = 0; i < j; ++i)
            {
                GSUB.LookupTable lookupTable = lookupTables[i];
                //
                if (!EnableLigation &&
                    lookupTable.ForUseWithFeatureId == Features.liga.shortname)
                {
                    //skip this feature
                    continue;
                }

                lookupTable.DoSubstitution(outputCodePoints, 0, outputCodePoints.Count);
            }
        }
        public void DoSubstitution(IGlyphIndexList codePoints)
        {
            // Rebuild tables if configuration changed
            if (_mustRebuildTables)
            {
                RebuildTables();
                _mustRebuildTables = false;
            }

            // Iterate over lookups, then over glyphs, as explained in the spec:
            // "During text processing, a client applies a lookup to each glyph
            // in the string before moving to the next lookup."
            // https://www.microsoft.com/typography/otspec/gsub.htm
            foreach (GSUB.LookupTable lookupTable in _lookupTables)
            {
                for (int pos = 0; pos < codePoints.Count; ++pos)
                {
                    lookupTable.DoSubstitutionAt(codePoints, pos, codePoints.Count - pos);
                }
            }
        }
 public abstract bool DoSubstitutionAt(IGlyphIndexList glyphIndices, int pos, int len);
Beispiel #6
0
 public override bool DoSubstitutionAt(IGlyphIndexList glyphIndices, int pos, int len)
 {
     return(false);
 }
 public abstract void DoSubtitution(IGlyphIndexList glyphIndices, int startAt, int len);