当前位置: 首页>>代码示例>>C#>>正文


C# FontTable.GetOffset方法代码示例

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


在下文中一共展示了FontTable.GetOffset方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AdjustPos

        public void AdjustPos(  FontTable Table,
                                LayoutMetrics Metrics,
                                ref LayoutOffset GlyphOffset, 
                                ref int    GlyphAdvance
                             ) 
        { 
            int curOffset=offset;
 
            if ((format&XPlacmentFlag)!=0)
            {
                GlyphOffset.dx += Positioning.DesignToPixels(Metrics.DesignEmHeight,Metrics.PixelsEmWidth,
                                                                Table.GetShort(curOffset)); 
                curOffset+=2;
            } 
 
            if ((format&YPlacmentFlag)!=0)
            { 
                GlyphOffset.dy += Positioning.DesignToPixels(Metrics.DesignEmHeight,Metrics.PixelsEmHeight,
                                                                Table.GetShort(curOffset));

                curOffset+=2; 
            }
 
            if ((format&XAdvanceFlag)!=0) 
            {
                    GlyphAdvance += Positioning.DesignToPixels(Metrics.DesignEmHeight,Metrics.PixelsEmWidth, 
                                                                    Table.GetShort(curOffset));
                curOffset+=2;
            }
 
            if ((format&YAdvanceFlag)!=0)
            { 
                    GlyphAdvance += Positioning.DesignToPixels(Metrics.DesignEmHeight,Metrics.PixelsEmHeight, 
                        Table.GetShort(curOffset));
                curOffset+=2; 
            }

            if ((format&XPlacementDeviceFlag)!=0)
            { 
                int deviceTableOffset = Table.GetOffset(curOffset);
                if (deviceTableOffset != FontTable.NullOffset) 
                { 
                    DeviceTable deviceTable  = new DeviceTable(baseTableOffset+deviceTableOffset);
                    GlyphOffset.dx += deviceTable.Value(Table,Metrics.PixelsEmWidth); 
                }

                curOffset+=2;
            } 

            if ((format&YPlacementDeviceFlag)!=0) 
            { 
                int deviceTableOffset = Table.GetOffset(curOffset);
                if (deviceTableOffset != FontTable.NullOffset) 
                {
                    DeviceTable deviceTable  = new DeviceTable(baseTableOffset+deviceTableOffset);
                    GlyphOffset.dy += deviceTable.Value(Table,Metrics.PixelsEmHeight);
                } 

                curOffset+=2; 
            } 

            if ((format&XAdvanceDeviceFlag)!=0) 
            {
                if (Metrics.Direction==TextFlowDirection.LTR || Metrics.Direction==TextFlowDirection.RTL)
                {
                    int deviceTableOffset = Table.GetOffset(curOffset); 
                    if (deviceTableOffset != FontTable.NullOffset)
                    { 
                        DeviceTable deviceTable  = new DeviceTable(baseTableOffset+deviceTableOffset); 
                        GlyphAdvance += deviceTable.Value(Table,Metrics.PixelsEmWidth);
                    } 
                }

                curOffset+=2;
            } 

            if ((format&YAdvanceDeviceFlag)!=0) 
            { 
                if (Metrics.Direction==TextFlowDirection.TTB || Metrics.Direction==TextFlowDirection.BTT)
                { 
                    int deviceTableOffset = Table.GetOffset(curOffset);
                    if (deviceTableOffset != FontTable.NullOffset)
                    {
                        DeviceTable deviceTable  = new DeviceTable(baseTableOffset+deviceTableOffset); 
                        GlyphAdvance += deviceTable.Value(Table,Metrics.PixelsEmHeight);
                    } 
                } 

                curOffset+=2; 
            }
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:91,代码来源:Positioning.cs

示例2: Coverage

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

示例3: GetLangSysTable

 public LangSysTable GetLangSysTable(FontTable Table,ushort Index)
 {
     return new LangSysTable(offset + Table.GetOffset(offset+
                                                        offsetLangSysRecordArray +
                                                        Index*sizeLangSysRecord +
                                                        offsetLangSysRecordOffset));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:7,代码来源:OpenTypeCommon.cs

示例4: SubtableOffset

 public int SubtableOffset(FontTable Table, ushort Index)
 {
     Debug.Assert(Index < SubTableCount());
     return offset+Table.GetOffset(offset + offsetSubtableArray +
                                             Index*sizeSubtableOffset);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:6,代码来源:OpenTypeCommon.cs

示例5: IsDefaultLangSysExists

 public bool IsDefaultLangSysExists(FontTable Table)
 {
     return Table.GetOffset(offset + offsetDefaultLangSys)!=0;
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:OpenTypeCommon.cs

示例6: GetDefaultLangSysTable

        public LangSysTable GetDefaultLangSysTable(FontTable Table)
        {
            if (IsDefaultLangSysExists(Table))
                return new LangSysTable(offset+Table.GetOffset(offset+offsetDefaultLangSys));

            return new LangSysTable(FontTable.InvalidOffset);
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:7,代码来源:OpenTypeCommon.cs

示例7: GetScriptTable

 public ScriptTable GetScriptTable(FontTable Table, ushort Index)
 {
     return new ScriptTable(offset +
                             Table.GetOffset(offset + offsetScriptRecordArray +
                                                      Index*sizeScriptRecord +
                                                      offsetScriptRecordOffset));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:7,代码来源:OpenTypeCommon.cs

示例8: FindLangSys

        public LangSysTable FindLangSys(FontTable Table, uint Tag)
        {
            if (IsNull)
            {
                return new LangSysTable(FontTable.InvalidOffset);
            }

            if ((OpenTypeTags)Tag==OpenTypeTags.dflt)
            {
                if (IsDefaultLangSysExists(Table))
                    return new LangSysTable(offset +
                                    Table.GetOffset(offset + offsetDefaultLangSys));

                return new LangSysTable(FontTable.InvalidOffset);
            }

            for(ushort i=0;i<GetLangSysCount(Table);i++)
            {
                if (GetLangSysTag(Table,i)==Tag)
                {
                    return GetLangSysTable(Table,i);
                }
            }
            return new LangSysTable(FontTable.InvalidOffset);
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:25,代码来源:OpenTypeCommon.cs

示例9: GetMarkAttachClassDef

        // /// <summary>
        // /// Under construction
        // /// Glyph attachment points list
        // /// </summary>
        // /// <param name="Table"></param>
        // /// <returns></returns>
        //public GlyphAttachList GetGlyphAttachList(FontTable Table)
        //{
        //    return new GlyphAttachList(offset + Table.GetOffset(offset + offsetGlyphAttachList));
        //}

        // /// <summary>
        // /// Under construction
        // /// Ligature caret positioning data
        // /// </summary>
        // /// <param name="Table"></param>
        // /// <returns></returns>
        // //public LigatureCaretList GetLigatureCaretlist(FontTable Table)
        // //{
        // //    return new LigatureCaretList(offset + Table.GetOffset(offset + offsetLigaCaretList));
        // //}
        public ClassDefTable GetMarkAttachClassDef(FontTable Table)
        {
            //There is only one place where GDEF classdef is retireved -
            // GetNextGlyphInLokup We will check if GDEF is present there.
            Invariant.Assert(Table.IsPresent);

            return new ClassDefTable(offset+Table.GetOffset(offset+offsetMarkAttachClassDef));
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:29,代码来源:OpenTypeCommon.cs

示例10: GetGlyphClassDef

        public ClassDefTable GetGlyphClassDef(FontTable Table)
        {
            //There is only one place where GDEF classdef is retireved -
            // UpdateGlyphFlags. We will check if GDEF is present there
            Invariant.Assert(Table.IsPresent);

            return new ClassDefTable(offset + Table.GetOffset(offset + offsetGlyphClassDef));
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:8,代码来源:OpenTypeCommon.cs

示例11: GetLookupList

 public LookupList GetLookupList(FontTable Table)
 {
     return new LookupList(offset+Table.GetOffset(offset+offsetLookupList));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:OpenTypeCommon.cs

示例12: GetFeatureList

 public FeatureList GetFeatureList(FontTable Table)
 {
     return new FeatureList(offset+Table.GetOffset(offset+offsetFeatureList));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:OpenTypeCommon.cs

示例13: GetScriptList

 public ScriptList GetScriptList(FontTable Table)
 {
     return new ScriptList(offset+Table.GetOffset(offset+offsetScriptList));
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:OpenTypeCommon.cs


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