Ticket #47 (closed defect: fixed)

Opened 13 months ago

Last modified 10 months ago

There is no way to get list of faces from a font

Reported by: artem Owned by: artem
Priority: Milestone: 0.5.0
Component: Core Library Version: SVN Trunk
Severity: Normal Keywords: font face
Cc: Patch Needs Improvement:
Needs Docmentation: Has Patch?:
Design Decision Needed:

Description

At the moment there is no way to get list of available faces in a font.

Change History

Changed 13 months ago by gilles.bassiere

I use "Gnome Font Viewer" to take a peek at .ttf files. In the header, the "name" and "style" fields are useful, they indicate the face_name expected by mapnik when concatenated.

Example: for FreeSans?.ttf, I can read "Name: FreeSans?" and "Style: Medium" in Gnome Font Viewer. The face_name attribute should be "FreeSans? Medium".

Changed 10 months ago by artem

  • status changed from new to closed
  • resolution set to fixed
>>> for fname in FontEngine.face_names():
...     print fname
... 
DejaVu Sans Bold
DejaVu Sans Bold Oblique
DejaVu Sans Book
DejaVu Sans Condensed
DejaVu Sans Condensed Bold
DejaVu Sans Condensed Bold Oblique
DejaVu Sans Condensed Oblique
DejaVu Sans ExtraLight
DejaVu Sans Mono Bold
DejaVu Sans Mono Bold Oblique
DejaVu Sans Mono Book
DejaVu Sans Mono Oblique
DejaVu Sans Oblique
DejaVu Serif Bold
DejaVu Serif Bold Oblique
DejaVu Serif Book
DejaVu Serif Condensed
DejaVu Serif Condensed Bold
DejaVu Serif Condensed Bold Oblique
DejaVu Serif Condensed Oblique
DejaVu Serif Oblique
>>> 
Note: See TracTickets for help on using tickets.