Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

216
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda