• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Shaping.FontTable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MS.Internal.Shaping.FontTable的典型用法代码示例。如果您正苦于以下问题:C# FontTable类的具体用法?C# FontTable怎么用?C# FontTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FontTable类属于MS.Internal.Shaping命名空间,在下文中一共展示了FontTable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Apply

        public bool Apply(
                            FontTable          Table,
                            GlyphInfoList   GlyphInfo,      // List of GlyphInfo structs
                            int             FirstGlyph,     // where to apply it
                            out int         NextGlyph       // Next glyph to process
                         )
        {
            Invariant.Assert(FirstGlyph >= 0);
        
            NextGlyph = FirstGlyph + 1; //In case we don't match;
                
            ushort GlyphId = GlyphInfo.Glyphs[FirstGlyph];
            int CoverageIndex = Coverage(Table).GetGlyphIndex(Table,GlyphId);
            if (CoverageIndex == -1) return false;
            
            switch(Format(Table))
            {
                case 1:
                    GlyphInfo.Glyphs[FirstGlyph] = (ushort)(GlyphId + Format1DeltaGlyphId(Table));
                    GlyphInfo.GlyphFlags[FirstGlyph] = (ushort)(GlyphFlags.Unresolved | GlyphFlags.Substituted);
                    NextGlyph = FirstGlyph + 1;
                    return true;

                case 2:
                    GlyphInfo.Glyphs[FirstGlyph] = Format2SubstituteGlyphId(Table,(ushort)CoverageIndex);
                    GlyphInfo.GlyphFlags[FirstGlyph] = (ushort)(GlyphFlags.Unresolved | GlyphFlags.Substituted);
                    NextGlyph = FirstGlyph + 1;
                    return true;

                default:
                    NextGlyph = FirstGlyph+1;
                    return false;
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:34,代码来源:Substitution.cs


示例2: IsLookupCovered

 public bool IsLookupCovered(
                 FontTable table,
                 uint[] glyphBits,
                 ushort minGlyphId, 
                 ushort maxGlyphId)
 { 
     return true; 
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:8,代码来源:Context.cs


示例3: IsLookupCovered

 public bool IsLookupCovered(
                 FontTable table, 
                 uint[] glyphBits, 
                 ushort minGlyphId, 
                 ushort maxGlyphId)
 {
     return Coverage(table).IsAnyGlyphCovered(table,
                                              glyphBits,
                                              minGlyphId,
                                              maxGlyphId
                                             );
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:12,代码来源:Substitution.cs


示例4: GlyphCount

 public ushort GlyphCount(FontTable Table)
 {
     return Table.GetUShort(offset + offsetGlyphCount);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs


示例5: Format2SubstituteGlyphId

 // Not used. This value should be equal to glyph count in Coverage.
 // Keeping it for future reference
 //private ushort Foramt2GlyphCount(FontTable Table)
 //{
 //    Debug.Assert(Format(Table)==2);
 //    return Table.GetUShort(offset + offsetFormat2GlyphCount);
 //}       
 private ushort Format2SubstituteGlyphId(FontTable Table,ushort Index)
 {
     Invariant.Assert(Format(Table)==2);
     return Table.GetUShort(offset + offsetFormat2SubstitutehArray + 
                                     Index * sizeFormat2SubstituteSize);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:13,代码来源:Substitution.cs


示例6: Format

 public ushort Format(FontTable Table)
 {
     return Table.GetUShort(offset + offsetFormat);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs


示例7: Sequence

 // Not used. This value should be equal to glyph count in Coverage.
 // Keeping it for future reference
 //private ushort SequenceCount(FontTable Table)
 //{
 //    return Table.GetUShort(offset + offsetSequenceCount);
 //}
 
 private MultipleSubstitutionSequenceTable Sequence(FontTable Table, int Index)
 {
     return new MultipleSubstitutionSequenceTable(
                                 offset + 
                                 Table.GetUShort(offset +
                                                 offsetSequenceArray +
                                                 Index * sizeSequenceOffset)
                                );
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:16,代码来源:Substitution.cs


示例8: LigatureSet

 private LigatureSetTable LigatureSet(FontTable Table, ushort Index)
 {
     return new LigatureSetTable(offset+Table.GetUShort(offset+
                                                        offsetLigatureSetArray + 
                                                        Index * sizeLigatureSet));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:6,代码来源:Substitution.cs


示例9: LigatureSetCount

 private ushort LigatureSetCount(FontTable Table)
 {
     return Table.GetUShort(offset + offsetLigatureSetCount);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs


示例10: Apply

        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
            ) 
        {
            Invariant.Assert(Format(Table)==3); 
 
            NextGlyph = FirstGlyph + 1; //in case we don't match
 
            int glyphCount = GlyphInfo.Length;
            int glyphIndex;

            ushort backtrackGlyphCount = BacktrackGlyphCount(Table); 
            ushort inputGlyphCount     = InputGlyphCount(Table);
            ushort lookaheadGlyphCount = LookaheadGlyphCount(Table); 
 
            if (FirstGlyph < backtrackGlyphCount ||
                (FirstGlyph + inputGlyphCount) > AfterLastGlyph) 
            {
                return false;
            }
 
            bool match = true;
 
            //Check backtrack sequence 
            glyphIndex = FirstGlyph;
            for(ushort backtrackIndex = 0; 
                backtrackIndex < backtrackGlyphCount && match;
                backtrackIndex++)
            {
                 glyphIndex = LayoutEngine.GetNextGlyphInLookup(Font, GlyphInfo, 
                                                                glyphIndex-1,
                                                                LookupFlags, 
                                                                LayoutEngine.LookBackward 
                                                               );
 
                if (glyphIndex<0 ||
                    BacktrackCoverage(Table,backtrackIndex)
                            .GetGlyphIndex(Table,GlyphInfo.Glyphs[glyphIndex])<0)
                { 
                    match=false;
                } 
            } 

            if (!match) return false; 

            glyphIndex = FirstGlyph;
            for(ushort inputIndex = 0;
                inputIndex < inputGlyphCount && match; 
                inputIndex++)
            { 
                if (glyphIndex>=AfterLastGlyph || 
                    InputCoverage(Table,inputIndex)
                    .GetGlyphIndex(Table,GlyphInfo.Glyphs[glyphIndex])<0) 
                {
                    match=false;
                }
                else 
                {
                    glyphIndex = LayoutEngine.GetNextGlyphInLookup(Font, GlyphInfo, 
                        glyphIndex + 1, 
                        LookupFlags,
                        LayoutEngine.LookForward 
                        );
                }
            }
 
            if (!match) return false;
 
            int afterInputGlyph = glyphIndex; // remember where we were after input seqence 

            for(ushort lookaheadIndex = 0; 
                lookaheadIndex < lookaheadGlyphCount && match;
                lookaheadIndex++)
            {
                if (glyphIndex>=GlyphInfo.Length || 
                    LookaheadCoverage(Table,lookaheadIndex)
                    .GetGlyphIndex(Table,GlyphInfo.Glyphs[glyphIndex])<0) 
                { 
                    match=false;
                } 
                else
                {
                    glyphIndex = LayoutEngine.
                                    GetNextGlyphInLookup(Font, GlyphInfo, 
                                                         glyphIndex + 1,
                                                         LookupFlags, 
//.........这里部分代码省略.........
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:101,代码来源:Context.cs


示例11: CoverageChainingSubtable

        public CoverageChainingSubtable(FontTable Table, int Offset)
        { 
            offset = Offset;
            offsetInputGlyphCount = offsetBacktrackGlyphCount + sizeGlyphCount + 
                                      Table.GetUShort(offset+offsetBacktrackGlyphCount) * 
                                                                    sizeCoverageOffset;
 
            offsetLookaheadGlyphCount = offsetInputGlyphCount + sizeGlyphCount +
                                          Table.GetUShort(offset+offsetInputGlyphCount) *
                                                                   sizeCoverageOffset;
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:11,代码来源:Context.cs


示例12: ContextualLookups

 public ContextualLookupRecords ContextualLookups(FontTable Table) 
 {
     int recordCountOffset = offset + offsetLookaheadGlyphCount + sizeGlyphCount + 
                             LookaheadGlyphCount(Table) * sizeCoverageOffset; 
     return new ContextualLookupRecords(recordCountOffset+sizeGlyphCount,
                                         Table.GetUShort(recordCountOffset)); 
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:7,代码来源:Context.cs


示例13: LookaheadCoverage

 public CoverageTable LookaheadCoverage(FontTable Table, ushort Index)
 { 
     return new CoverageTable(offset +
                                 Table.GetUShort(offset+ 
                                                 offsetLookaheadGlyphCount + 
                                                 sizeGlyphCount +
                                                 Index*sizeCoverageOffset) 
                             );
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:9,代码来源:Context.cs


示例14: BacktrackCoverage

 public CoverageTable BacktrackCoverage(FontTable Table, ushort Index) 
 {
     return new CoverageTable(offset +
                                 Table.GetUShort(offset+
                                                 offsetBacktrackGlyphCount + 
                                                 sizeGlyphCount +
                                                 Index*sizeCoverageOffset) 
                             ); 
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:9,代码来源:Context.cs


示例15: Glyph

 public ushort Glyph(FontTable Table, ushort index)
 {
     return Table.GetUShort(offset + offsetGlyphArray + index * sizeGlyphId);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs


示例16: Format1DeltaGlyphId

 private short Format1DeltaGlyphId(FontTable Table)
 {
     Invariant.Assert(Format(Table)==1);
     return Table.GetShort(offset + offsetFormat1DeltaGlyphId);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:5,代码来源:Substitution.cs


示例17: LigatureCount

 public ushort LigatureCount(FontTable Table)
 {
     return Table.GetUShort(offset + offsetLigatureCount);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs


示例18: Ligature

 public LigatureTable Ligature(FontTable Table, ushort Index)
 {
     return new LigatureTable(offset + Table.GetUShort(offset + 
         offsetLigatureArray + 
         Index * sizeLigatureOffset));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:6,代码来源:Substitution.cs


示例19: Coverage

 private CoverageTable Coverage(FontTable Table)
 {
     return new CoverageTable(offset + Table.GetUShort(offset + offsetCoverage));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs


示例20: LigatureGlyph

 public ushort LigatureGlyph(FontTable Table)
 {
     return Table.GetUShort(offset + offsetLigatureGlyph);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:Substitution.cs



注:本文中的MS.Internal.Shaping.FontTable类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XPath.Query类代码示例发布时间:2022-05-26
下一篇:
C# UnsafeNativeMethods.PTS类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap