![]() |
Forum Index : Microcontroller and PC projects : MM2: Graphics V2.0 with HK fonts
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
I've integrated the Henning Karlsen font handling into the graphics routines. The code has been simplified to remove separate font rotation and is designed to work on display controllers that support hardware rotation. Other controllers will have to use the existing version. Rotated fonts are then easily achieved by changing the screen rotation, printing the text, and then rotating it back. You will need to work out appropriate x,y coordinates for the text in the rotated screen - the demo program has examples of this. The choice of fonts is done through the size parameter in the pstring subroutine. Sizes 1 through n use the original font scaled appropriately Size 0 selects the HK font. I'm attaching a file of all the HK fonts compiled into Cfunctions. To use a particular font paste the font file into your code and then change the cfunction name to font0. This will then be automatically picked up when you use size 0. The demo code uses the 50x32 seven-segment font as an example. It is perfectly possible (depending on code space) to use multiple HK fonts. There is an array AddrOfFont() that is loaded with pointers to the fonts. This can be expanded in size and additional fonts added purely by changing the Basic code. I've also exposed the single pixel write function and included a demo of drawing a simple graph. The code attached works on ILI9341 displays using the SPI interface. I've stripped out the touch screen handling. You can just cut and paste this back in from previous versions if required. Displays based on the ST7735 and S6D02A1 will also work, just replace the initialisation code. The code contains pinout examples for 28,44,64 and 100-pin MMs. If you want a version for a parallel ILI9341 display let me know, I have it working on a 100-pin MM (should also work on 64) but the Cfunctions will be different for 28 and 44. Basic code: 2015-02-04_134000_ILI9341serialfonts.zip Fonts: 2015-02-04_134043_Fonts.zip C code: 2015-02-04_134129_ILI9341ST7735.zip |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1629 |
Hi Peter Very COOOL! ![]() But it seems be to something wrong with that font file. Please take a look on it. I could use the code for 28pin MMs and parallel ILI9341 displays. Thank you for this great stuff! MIchael causality ≠ correlation ≠ coincidence |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
Sorry I didn't check the files carefully enough - I must have broken CFuncGen trying to do them all at once ![]() Try this 2015-02-04_142939_Font.zip |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1629 |
looks good! ![]() I like this HK fonts! Thanka again! Michael Btw. if you sometime have too much spare time: how about a (side) scroll function? I hope this does not sound outrageous! causality ≠ correlation ≠ coincidence |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
Version for parallel ILI9341 on 28 or 44 pin MM2 Basic file: 2015-02-04_151847_ILI9341parallelfonts28-44.zip C File: 2015-02-04_151929_ILI9341parallelfonts28-44.zip |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1629 |
WOW, that's fast! Faster than I can boot up my PC! Very appreciated! ![]() I need only 11 connections to the MM? D0-D7,WR=9, RS=10, Reset and VCC+GND + RD to VCC, CS to GND causality ≠ correlation ≠ coincidence |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Peter, Is it a correct assumption that you are using the parallel port in a 6800 configuration? When choosing a LCD it is often one of the options to choose from. (The other is 8080). In that case an extra pin is needed for the RD. Is the choice 6800 or is it either possible? Microblocks. Build with logic. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
No idea - RD is held high as I never read |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |