Ejemplo n.º 1
0
 private short Format1DeltaGlyphId(FontTable Table)
 {
     Invariant.Assert(Format(Table)==1);
     return Table.GetShort(offset + offsetFormat1DeltaGlyphId);
 }
Ejemplo n.º 2
0
        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; 
            }
        }
Ejemplo n.º 3
0
 private short YCoordinate(FontTable Table)
 { 
     return Table.GetShort(offset + offsetYCoordinate);
 }
Ejemplo n.º 4
0
 private short Format1DeltaGlyphId(FontTable Table)
 {
     Invariant.Assert(Format(Table) == 1);
     return(Table.GetShort(offset + offsetFormat1DeltaGlyphId));
 }