Cosmos/source2/Users/Orvid/Orvid.Graphics/FontSupport/bdf/BDFFontMetrics.cs
blah38621_cp 92dcac4a51 Made a few improvements to the speed of the ILScanner, including caching the resolved plugs.
Added the possibility for an optimization step in the IL2CPU MSBuild task. Currently commented out, but should work fine with a few modifications to the optimizer.
Moved classes that are dependent on Cosmos from the Orvid.Graphics, into the Orvid.Graphics.Cosmos assembly. 
Re-factored the font mechanism, added partially working .fnt Font support. 
Added a Rectangle class, and a Vec2d class, which is the same as Vec2, except with doubles for the X and Y values.
Made a small aesthetic improvement to the output of the File2ByteArray Converter.
2011-09-03 21:05:46 +00:00

55 lines
1.3 KiB
C#

using System;
namespace Orvid.Graphics.FontSupport.bdf
{
internal class BDFFontMetrics : FontMetrics
{
private readonly BDFMetrics metrics;
public BDFFontMetrics(BDFFont font)
: base(font)
{
this.metrics = font.getContainer().getFontMetrics();
}
public override int GetHeight()
{
return metrics.getHeight();
}
public override int GetAscent()
{
return metrics.getAscent();
}
public override int GetDescent()
{
return metrics.getDescent();
}
public override int GetLeading()
{
return metrics.getLeading();
}
public override int GetMaxAdvance()
{
return metrics.getMaxAdvance();
}
public override int CharWidth(char ch)
{
return metrics.charWidth(ch);
}
public override int[] CharsWidths(char[] chars, int start, int len)
{
return metrics.charsWidths(chars, start, len);
}
public override int CharsWidth(char[] chars, int start, int len)
{
return metrics.charsWidth(chars, start, len);
}
}
}