You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

canvas-fonts

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-fonts

A library providing 200+ fonts for canvas editors

0.2.0
pipPyPI
Maintainers
1

canvas_fonts

A Python library providing 200+ fonts for use in canvas editors like Fabric.js-based applications.

Features

  • 200+ carefully curated fonts from Google Fonts
  • Organized into categories:
    • Sans-serif fonts (Roboto, Open Sans, etc.)
    • Serif fonts (Merriweather, Playfair Display, etc.)
    • Display fonts (Bebas Neue, Pacifico, etc.)
    • Monospace fonts (Source Code Pro, Fira Code, etc.)
    • Handwriting fonts (Dancing Script, Caveat, etc.)
    • Decorative fonts (Abril, Akronim, etc.)
  • Easy-to-use API for font management
  • Compatible with most canvas-based editors

Installation

pip install canvas-fonts

Usage

from canvas_fonts import get_fonts, get_font_path

# List all available fonts
fonts = get_fonts()
print(fonts)  # Returns list of 200+ font names

# Get path to a specific font file
path = get_font_path("Roboto")
print(path)  # Returns absolute path to Roboto.ttf

Font Categories

  • Sans-serif Fonts

    • Perfect for body text and UI elements
    • Includes: Roboto, Open Sans, Lato, Montserrat, and more
  • Serif Fonts

    • Ideal for headings and long-form content
    • Includes: Merriweather, Playfair Display, Lora, and more
  • Display Fonts

    • Great for headlines and attention-grabbing text
    • Includes: Bebas Neue, Pacifico, Dancing Script, and more
  • Monospace Fonts

    • Perfect for code snippets and technical content
    • Includes: Source Code Pro, Fira Code, JetBrains Mono, and more
  • Handwriting Fonts

    • Adds a personal touch to designs
    • Includes: Dancing Script, Caveat, Indie Flower, and more
  • Decorative Fonts

    • Ideal for special occasions and unique designs
    • Includes: Abril, Akronim, Aladin, and more

License

MIT License - See LICENSE file for details.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts