Skip to main content

Inkplate 6FLICK MicroPython - Printing text

Inkplate 6FLICK allows you to print text on a 1024 x 758 px canvas.

Displaying basic information

Below is a simple example demonstrating the simple way of displaying the information on the Inkplate display.

from inkplate6_flick import Inkplate # Include the Inkplate module

inkplate = Inkplate(Inkplate.INKPLATE_1BIT) # Create a display instance (8-level grayscale)

inkplate.begin() # Initialize the display

inkplate.set_text_size(2) # Scale up the font size

inkplate.set_cursor(380, 350) # Set the cursor from where the text will be written

inkplate.print("Hello world!") # Print to the display buffer

inkplate.display() # Display what is drawn to the buffer

inkplate.print()

Puts the text in display buffer at the current position on display

Function parameters:

TypeNameDescription
StringtextString to render.
Inkplate 6FLICK running the example code
Displaying basic information

Displaying text in Grayscale and more text parameters

Inkplate 6FLICK also lets you render 2-bit grayscale graphics (0-3) on its canvas. You can also modify different text parameters, such as: text color, text size and text wrapping. Below is a simple example demonstrating different text colors using grayscale and different text styles:

ℹ️

Color parameter in 'set_text_color()' changes text color as per table below:

VALUECOLOR
0Black
1Dark grey
2Dark grey
3White
from inkplate6_flick import Inkplate
import time

# Create Inkplate object in 2-bit grayscale mode
inkplate = Inkplate(Inkplate.INKPLATE_2BIT)

# Initialize the display, needs to be called only once
inkplate.begin()

# Clear the frame buffer
inkplate.clear_display()
inkplate.display()


inkplate.set_cursor(50, 50)
inkplate.set_text_size(1)
inkplate.set_text_color(0) # black
inkplate.print("Size 1")

inkplate.set_cursor(50, 100)
inkplate.set_text_size(2)
inkplate.set_text_color(1) # dark gray
inkplate.print("Size 2")

inkplate.set_cursor(50, 180)
inkplate.set_text_size(3)
inkplate.set_text_color(2) # light gray
inkplate.print("Size 3")

inkplate.set_text_color(0) # black
long_text = (
"This is a very long line of text intended to demonstrate how wrapping works. "
"When wrap mode is enabled, the text will continue onto the next line once it "
"reaches the edge of the display. This makes it possible to write paragraphs "
"or larger blocks of text without worrying about manually inserting line breaks. "
"It is especially useful for rendering user interfaces, menus, or e-books."
)
inkplate.set_cursor(50, 340)
inkplate.set_text_size(1)
inkplate.set_text_wrapping(True)
inkplate.print(long_text)

inkplate.set_cursor(50, 480)
inkplate.set_text_size(1)
inkplate.set_text_wrapping(False)
inkplate.print(long_text)

inkplate.display()

inkplate.set_cursor()

Set the cursor position for the next text to be rendered.

Function parameters:

TypeNameDescription
NumberxX coordinate for the text start.
NumberyY coordinate for the text baseline.

inkplate.set_text_size()

Set the text size scaling factor.

Function parameters:

TypeNameDescription
NumbersizeScale factor (1 = normal, 2 = double, 3 = triple, …).

inkplate.set_text_color

Set the text color (grayscale level) used for text rendering.

Function parameters:

TypeNameDescription
NumbercolorGrayscale value for text (0 = white to 3 = black in 2-bit mode).

inkplate.set_text_wrapping()

Enable or disable automatic text wrapping when reaching the display edge.

Returns value: Nothing

Function parameters:

TypeNameDescription
BooleanwrapTrue to wrap text, False to let it continue off-screen.
Inkplate 6FLICK running the example code
Simple grayscale example with different text styles.

Full examples

hello_world.py

Display text on the screen.

custom_font.py

Swap in one of the extra typefaces shipped under fonts/ instead of the default font.