Skip to content

[.ttf variation] How to get all the font fullname? #2639

Answered by moi15moi
moi15moi asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, again me.

I just saw that it was write in the stat page in the opentype documentation.

Windows (DirectWrite) seems to follow the R/B/I/BI model + an validation for the family (if nameID 16 does not exist, take nameID 1) so here is the code for it.

import sys
from typing import Dict, List
from fontTools import ttLib
from fontTools.ttLib import ttFont
from fontTools.ttLib.tables._f_v_a_r import NamedInstance
from fontTools.ttLib.tables._n_a_m_e import NameRecord


def sortNamingTable(names: List[NameRecord]) -> List[NameRecord]:
    """
    Parameters:
        names (List[NameRecord]): Naming table
    Returns:
        The sorted naming table.
        Based on FontConfig:
        - htt…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@moi15moi
Comment options

Comment options

You must be logged in to vote
2 replies
@moi15moi
Comment options

@khaledhosny
Comment options

Comment options

You must be logged in to vote
2 replies
@ftCLI
Comment options

@moi15moi
Comment options

Answer selected by moi15moi

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants