Main Site Documentation

How to draw text on the display


#1

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!


#2

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


#5

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

What? My brain?:relaxed:


#6

I guess I should have stated I am using TinyCLR 0.6.0

I’m not sure how the link applies.


#7

@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


#8

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


#9

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.


#10

@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).


#11

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).


#12

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


#13

@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.
https://msdn.microsoft.com/en-us/library/cc533019.aspx

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.

https://msdn.microsoft.com/en-us/library/cc533017.aspx


#14

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


#15

Latest progress