Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda