Automattic / Automattic/node-canvas

List available fonts?

Open
#1,551 1 comment 0 reactions 0 assignees View on GitHub
Feature Text & Fonts
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## Issue or Feature

Is it currently possible to get a list of the available fonts? - i can't see an applicable api...
It seems this should be possible in pango using pango_font_map_list_families (); I understand it's not a feature of HTML5 canvas, but we already have some extended features, including RegisterFont in node-canvas.

If it's not currently possible, is it something which others are interested in? Certainly for me, as both an aid to giving a user an informed choice, and as a diagnostic aid when display is not as expected, this would be a really useful feature; and on the face of it does not seem to be terribly difficult to implement. If you've looked at it before and rejected it as difficult, then please don't let me plough on and try without discussion :).

s

## Steps to Reproduce

## Your Environment
latest version of canvas, Windows, MAC, Linux

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing RegisterFont API and the node-canvas installation context, then investigate the Pango pango_font_map_list_families() entry point mentioned in the issue. Done means providing a way to retrieve available font families on Windows, macOS, and Linux, with the API shape and behavior agreed on first.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.