mirror of
https://github.com/fadden/6502bench.git
synced 2024-11-30 01:50:10 +00:00
Add properties for font cell width/height
Can be used by visualizers.
This commit is contained in:
parent
31d466f0bd
commit
3f7d03c798
@ -18,7 +18,20 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace CommonUtil {
|
||||
/// <summary>
|
||||
/// 8x8 monochrome cells. The right and bottom edges of each cell are left blank,
|
||||
/// so glyphs can be packed tightly.
|
||||
/// </summary>
|
||||
public static class Font8x8 {
|
||||
/// <summary>
|
||||
/// Returns an 8-byte array for the specified character. Each byte represents one
|
||||
/// row. The first byte holds the top row, and the most significant bit in each
|
||||
/// byte is the leftmost pixel.
|
||||
///
|
||||
/// If no glyph is defined, returns the Unicode REPLACEMENT CHARACTER glyph.
|
||||
/// </summary>
|
||||
/// <param name="ch">Requested character.</param>
|
||||
/// <returns>Reference to int[8] with data (do not modify contents).</returns>
|
||||
public static int[] GetBitData(char ch) {
|
||||
if (sBitData == null) {
|
||||
InitBitData();
|
||||
|
@ -141,8 +141,11 @@ namespace PluginCommon {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws an 8x8 character on the bitmap.
|
||||
/// Draws an 8x8 character cell on the bitmap.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Might want a way to specify that the background shouldn't be drawn at all.
|
||||
/// </remarks>
|
||||
/// <param name="vb">Bitma to draw on.</param>
|
||||
/// <param name="ch">Character to draw.</param>
|
||||
/// <param name="xc">X coord of upper-left pixel.</param>
|
||||
@ -168,5 +171,9 @@ namespace PluginCommon {
|
||||
yc++;
|
||||
}
|
||||
}
|
||||
|
||||
// Character cell dimensions.
|
||||
public static int CharWidth { get { return 8; } }
|
||||
public static int CharHeight { get { return 8; } }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user