mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 14:02:19 +00:00
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.
55 lines
1.3 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|