Skip to content

Firefox download broken #508

@gmurph91

Description

@gmurph91

Firefox downloads broken

embed only used fonts (#476) (09bee44) breaks downloads in firefox (html-to-image versions >= 1.11.12)

TypeError: font is undefined.

Expected Behavior

Firefox downloads should work

Current Behavior

Firefox is broken

Possible Solution

rule.style.fontFamily is undefined

Steps To Reproduce

  1. upgrade html-to-image to 1.11.12
  2. download image in firefox (not sure if it needs to include a local font)
Error Message & Stack Trace

TypeError: font is undefined
    normalizeFontFamily embed-webfonts.ts:206
    cssTexts embed-webfonts.ts:237
    getWebFontCSS embed-webfonts.ts:236
    embedWebFonts embed-webfonts.ts:259

Additional Context

Your Environment

  • html-to-image: ^1.11.12
  • OS: macOS Sonoma 14.6.1
  • Browser: Firefox 135.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions