Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
How to list opentype font feature names from a font using opentype.js?

In a JS environment I want to list the a font's 'font features' so that I can set them with font-feature-settings css.

Is there a better alternative than opentype.js?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Font features can be extracted from the GSUB table.

Here is a simple example listing the font feature names from

import opentype from 'opentype.js'

async function listFontFeatures()
{    
    const font = await  opentype.load("C:\\Windows\\Fonts\\arial.ttf");
    const featureNames = [...Array.from(new Set(font.tables.gsub.features.map((f: any) => f.tag)))]

    for (const name of featureNames)        
        console.log(name);
}

listFontFeatures();

This displays the 4 char font feature codes :

c2sc calt ccmp dlig dnom fina frac init isol liga lnum locl medi numr onum

Human readable names can be looked up from here

about 4 years ago · Juan Pablo Isaza Report

0

I've created an opentype.features.js npm package, which does more than opentype.js, with respect to listing font features.

Along with listing the feature tags, it also lists the feature descriptions and option labels.

Example output:

...,{"tag":"cv13","description":"Cap B-hook alt","options":["Lowercase style"]},...

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!