Git Product home page Git Product logo

kivysome's Introduction

kivysome

GitHub Workflow Status (branch) Codecov Dependabot Status Libraries.io dependency status for latest release CodeFactor security: bandit Code style: black PyPI - Python Version PyPI PyPI - Downloads GitHub License GitHub last commit

Font Awesome 5 Icons for Kivy

Usage

Enable it

Using a version

This will only work for free versions of Font Awesome.

import kivysome 
kivysome.enable(kivysome.LATEST, group=kivysome.FontGroup.REGULAR)

Using a kit

Kits will not be maintained any further. They will work as long as Font Awesome don't change their API.

1. Generate your kit

Go to Font Awesome and generate your kit there. The specified version is respected. For the moment, only free licenses are supported.

2. Enable it

In your main.py register your font:

import kivysome 
kivysome.enable("https://kit.fontawesome.com/{YOURCODE}.js", group=kivysome.FontGroup.SOLID)

3. Use it

In your .kv file or string, reference the short Font Awesome (i.e., without fa- prefix) as you can copy them from their website.

#: import icon kivysome.icon
Button:
    markup: True # Always turn markup on
    text: "%s Comment" % icon('comment', 24)

Caching

Kivysome will cache the files in the font folder and not redownload them from GitHub. If a kit is given, however, the kit version will have to be fetched from Font Awesome on every execution. If kivysome.LATEST is given, the latest version will also have to be determined from GitHub's servers. Font packs will only be downloaded if new versions are published, then. To completely avoid regular server access, a pinned version will have to be given. The initial download can also be circumvented by downloading it a single time on the developer's machine and publishing the downloaded fonts folder with the project. The folder should then contain a .css, .fontd, and a .ttf file matching the pinned Font Awesome version and font group.

Check the examples folder for more insight.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.