Skip to content

FontFamily default name mapping missing #250

@mattjuggins

Description

@mattjuggins

The 'default' fontFamilyType isn't mapped correctly, resulting in no fontFamily styling being applied to subtitle elements.

As far as I understand:

  • There are several FontFamilyTypes, specified in EBU-TT-D (Section 4.4.), including default.
  • html.js interprets tts:fontfamily and converts these family types to generic font families, or to appropriate named fonts.
  • default is not handled as a specific case in html.js so it ends back unmapped into the value for fontFamily to be applied to an element.
  • The fontFamily style is not applied because default is a reserved word in CSS and hence not a valid font family name.

In the IMSC specification, there is a mention that default should be interpreted as monospaceSerif. As duplicate font family names are cleared up later in the code I think it would be fair to change the monospaceSerif case to the following in `html.js:

if (attr[i] === "monospaceSerif" || attr[i] === "default") { ...

This also seems to be considered in styles.js..

If this all checks out I'm happy to make the change and raise a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions