Skip to content

openpdf-html: Improve support for CSS @font-face #1426

@alexdupre

Description

@alexdupre

The current support for the @font-face rule has a few issues:

  1. the src property is not correctly parsed, because the code expects a single url function, but there can be others (like format):
  2. the font file format is determined by the file extension, but the font url might not have a standard extension: the format function should be the preferred method to determine the type, with fallback on file extension:
    return lower.endsWith(OTF) || lower.endsWith(TTF) || lower.contains(TTC_COMMA);
  3. there is no way to embed fonts if the @font-face rule comes from an external @import (so no way to add -fs-pdf-font-embed: embed)
  4. given that there is no support for the format function, probably it doesn't currently support the presence of multiple url with different formats, from which to choose the supported one

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions