How to draw text on the display

On my G120E Dev board 1.2 I got the display working and I can use the graphic like:

theDisplay.DrawEllipse, theDisplay.FillRectangle etc.

I want to draw text but I do not know how to use/assign System.Drawing.Font.

Graphics.DrawString(string, System.Drawing.Font, System.Drawing.Brush, float, float);

Any help would be appreciated!

Start with https://ghielectronics.com/docs/34/graphics#3200

It’s almost the size of a usb type A connector.

What? My brain?:relaxed:

I guess I should have stated I am using TinyCLR 0.6.0

I’m not sure how the link applies.

@willgeorge

i crated wrong post here and deleted.

And @Mr_John_Smith answered to my post !

so i apologize for creation of mistake there and cause confusions and change thread

so i apologize
There is no need. Really. Things happen!

Assuming that TinyClr uses tiny fonts, then the link says you need to put the font into the project resources and then load it into memory. Should apply to TinyClr.

Try it and let us know if it worked.

@Mike is correct. TinyCLR fonts currently use the same format as NETMF, so you can use any existing fonts you may have. Just add them as a resource to your project then you can access them like normal: Resources.GetFont(Resources.FontResources.MyFont).

YES!
I got a string displayed!

Mike got me on the right path. Thanks Mike!

Using fonts NinaB.tinyfnt and small.tinyfnt as a resource.
I just copied the Resources Folder from a old NetMicro application (VS 2013) into my VS 2017 application.
(Well I have to try and remember all the steps I really had to do)

My test is a kludge by any REAL programmers standards but I have fun anyway.

I do have a problem with my displayController settings because X is off by 27 pixels. but other than that at least the display works.
(I’ll have to ask theEXPERTS about that).

For future reference, NETMF fonts are usually found in C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.4\Fonts and C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3

@willgeorge

Creating a .tinyfnt Font File

This section provides an overview of the TinyFNT file format and the steps required to create a .tinyfnt font file.
Creating a .tinyfnt Font File | Microsoft Learn

Adding Fonts To Your Application

This section provides an overview of the steps required to reference and use fonts in a .NET Micro Framework application.

1 Like

http://informatix.miloush.net/microframework/Utilities/TinyFontTool.aspx

Latest progress

2 Likes