Skip to content

Get all the possible combination of Material Symbols in Truetype format

License

Notifications You must be signed in to change notification settings

T-Dynamos/materialsymbols-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

materialsymbols-python

GitHub repo size img

Get all the possible combination of Material Symbols!

This repo provides fonts in fonts/ path. You can also use generator.py to generate latest fonts yourself. These will be saved in fonts/ dir.

Format of fonts: Material_Symbols_<FONT_TYPE>-<OPTICAL_SIZE>-<WEIGHT>-<FILL>_<GRAD>.ttf

Example : https://github.com/T-Dynamos/materialsymbols-python/raw/main/fonts/Material_Symbols_Outlined-20-100-0_-25.ttf

Possible values:

# Possible values
FONT_TYPE = ["Outlined", "Rounded", "Sharp"]
OPTICAL_SIZE = ["20", "24", "40", "48"]  # in px
GRAD = ["-25", "0", "200"]
WEIGHT = ['100', '200', '300', '400', '500', '600', '700']
FILL = [1,0]

What does this means:

ii

See More : https://m3.material.io/styles/icons/overview

Why this?

This project exists because not all libraries support variable fonts, such as SDL. It aims to provide a solution for using variable fonts in libraries that do not support them. By converting the variable font to a set of static fonts, this project allows for the use of variable fonts in any library that supports static fonts.

Usage

To use this repository, follow these steps:

  1. Choose your favorite font file and download it. You can use it anywhere.
  2. Type the Unicode character, for example: \ue769

You can find the Unicode character for each icon at https://fonts.google.com/icons.

Here's an example of how the icon would look like with its Unicode character:

Screenshot_20230501_223656

That's it! You can now use any Material Symbol for your projects.

Kivy Example:

from kivy.app import App
from kivy.lang import Builder

UI = Builder.load_string(
"""
Label:
    text:"\ue769"
    font_name:"fonts/Material_Symbols_Rounded-20-100-0_-25.ttf"
    font_size:"300sp"
    halign:"center"
"""
)


class Testapp(App):

    def build(self):
        return UI

Testapp().run()