Custom font size on GLCD (Almost solved)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Custom font size on GLCD (Almost solved)

Post by bercioiu »

Hi all!
There is a way to print very large font (only numbers, see picture) , on a GLCD 128x64 oled i2c ssd1306?

Thank you!
Attachments
big_font.jpg
big_font.jpg (23.59 KiB) Viewed 12082 times
Last edited by bercioiu on Tue May 09, 2017 10:42 pm, edited 2 times in total.

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: Custom font size on GLCD

Post by bercioiu »

What changes need to be made to modify an existing font? I tried to print in lines and points but it's almost impossible, there are over 8000 pixels ...
Thank you!

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Custom font size on GLCD

Post by LeighM »

It might be easier to create the digits out of rectangles?

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: Custom font size on GLCD

Post by bercioiu »

Understand from your answer that there is no way to change the existing font?
Do you imagine how many x,y (rectangle) I have to put for all 4 digits?

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Custom font size on GLCD

Post by LeighM »

From your image it looks like you want 7 segment digits?
In which case you could create a macro that draws a digit with 7 rectangles?
So the macro would have as parameters, the digit to display and the offset/position on screen.

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: Custom font size on GLCD

Post by bercioiu »

I tried but there is a problem, how do I delete the previous segments to print the new number?

VIDEO:
https://youtu.be/yeRX73yWdjY
Last edited by bercioiu on Mon May 08, 2017 10:13 pm, edited 3 times in total.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Custom font size on GLCD

Post by kersing »

Several solutions:
1) Clear the screen and redraw everything,
2) Draw the segment using the background colour.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: Custom font size on GLCD

Post by bercioiu »

Thank you for your reply!

1) In the upper link is a video with clear screen.
2) Can not draw rectangles with the outline of the background color

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Custom font size on GLCD

Post by kersing »

You should be able to use macros 'SetBackgroundColour' and 'SetForegroundColour' to change the drawing colours before calling the DrawRectangle macro.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: Custom font size on GLCD

Post by bercioiu »

I think I'll quit. I'll finish the project with Arduino. With Arduino I can do any fonts that I want...

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Custom font size on GLCD

Post by Benj »

I think I'll quit. I'll finish the project with Arduino. With Arduino I can do any fonts that I want...
That way you won't get the sense of achievement when it's all working :(

It sounds like your very close. Post your program so far and we will be able to help.

Variable fonts is something we are considering but getting them right is tricky. We could however offer more scaling options without too much effort.

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: Custom font size on GLCD

Post by bercioiu »

I'm getting closer :-)
The refresh of the segments is a little weak, but given that they are "drawn" I will live with them ...

Video"

https://www.dropbox.com/s/1mhoync2xy5kf ... 3.mp4?dl=0

Post Reply