PyCairo - Displaying Text Last Updated : 12 Nov, 2020 Comments Improve Suggest changes Like Article Like Report In this article, we will learn how we can display text using PyCairo in python. PyCairo : Pycairo is a Python module providing bindings for the cairo graphics library. This library is used for creating SVG i.e vector files in python. The easiest and quickest way to open an SVG file to view it (read-only) is with a modern web browser like Chrome, Firefox, Edge, or Internet Explorer—nearly all of them should provide some sort of rendering support for the SVG format. SVG file is a graphics file that uses a two-dimensional vector graphic format created by the World Wide Web Consortium (W3C). It describes images using a text format that is based on XML. SVG files are developed as a standard format for displaying vector graphics on the web. Steps of Implementation : Import the Pycairo module.Create an SVG surface object and add context to it.Setting text color, font size and style using set_source_rgb ( ) , set_font_size ( ) , select_font_face( )Display the text using show_text ( ) Below is the Implementation: Python3 # code import cairo print("GFG") # importing pycairo # creating a SVG surface # here geek95 is file name & 700, 700 is dimension with cairo.SVGSurface("geek95.svg", 700, 700) as surface: # creating a cairo context object for SVG surface # using Context method context = cairo.Context(surface) # setting color of the context context.set_source_rgb(0, 0, 0) # approximate text height context.set_font_size(25) # Font Style context.select_font_face( "Arial", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) # position for the text context.move_to(50, 50) # displays the text context.show_text("GeeksForGeeks") # stroke out the color and width property context.stroke() # printing message when file is saved print("File Saved") Output : Comment More infoAdvertise with us Next Article PyCairo - Displaying Text A ayush12arora Follow Improve Article Tags : Python Python-PyCairo Practice Tags : python Similar Reads PyCairo - Creating Text Paths In this article, we will learn how we can display text and converting text into paths using PyCairo in python. You can convert a text string to a path. Once you have the path then you can fill it (that will look similar to just displaying text the normal way), or just outline it, or both. PyCairo : 3 min read Python Arcade - Display Text In this article, we will learn How we can add text to arcade games in Python. Adding Simple Text We can add text in the arcade using the draw_text() function. Syntax: arcade.draw_text(text, x, y, color, size, width, align, font_name) Parameters: text: Text we want to displayx : x coordinatey : y coo 3 min read Python | Display text to PyGame window Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language. Now, itâs up to the imagination or necessity of the developer, what type of game he/she wants to develop usin 6 min read PYGLET â Getting Window Display In this article we will see how we can get the window display in PYGLET module in python. Pyglet is easy to use but powerful library for developing visually rich GUI applications like games, multimedia etc. A window is a "heavyweight" object occupying operating system resources. Windows may appear a 2 min read MoviePy â Creating Text Clip In this article we will see how we can create a text clip in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GIFâs. Video is formed by the frames, combination of frames creates a video each frame is an individual image. Text clip is basical 2 min read Like