Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# RGBLedCanvas.DrawText. #1699

Open
YesItsBenji opened this issue Aug 21, 2024 · 1 comment
Open

C# RGBLedCanvas.DrawText. #1699

YesItsBenji opened this issue Aug 21, 2024 · 1 comment

Comments

@YesItsBenji
Copy link

I cannot for the life of me ge the drawText function to work at all. Ive tried the FontExample.cs sample, and even that isnt working, ive even tried using absolute file paths when referencing the font, but to no avail.

Heres a code snippet. This code doesnt doesnt show anything at all.

var font = new RGBLedFont("assets/4x6.bdf");
canvas.Clear();
// canvas.DrawText(font, 1, 6, new Color(0, 255, 0), "Testing font");
canvas.DrawText(font, 10, 10, new Color(0, 255, 0), "Testing font");
font.DrawText(canvas._canvas, 1, 6, new Color(0, 255, 0), "Testing font");
matrix.SwapOnVsync(canvas);

However it would apear that the following is working:

canvas.DrawLine(0,0,canvas.Width,canvas.Height, new Color(255, 0, 0));
canvas.DrawLine(0,canvas.Height,canvas.Width,0, new Color(0, 255, 0));
matrix.SwapOnVsync(canvas);
@marcogruhl
Copy link

As a long shot, did you copy the font files to the output directory? (Build Action - Content) Or, when using absolute paths, did you have rights to read the files? (Unix systems)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants