Skip to content

Support Multi-Size SVG Variants in Icon Generation for Crisp Rendering #980

@jonathansampson

Description

@jonathansampson

Description:

Currently, the Leo pipeline converts a single default SVG (e.g. browser-back.svg) into a .icon file. This .icon file contains only one representation, which can lead to blurry icons on non-HDI displays because Chromium’s system expects multiple, size-optimized representations (using CANVAS_DIMENSIONS blocks).

Proposed Solution:

  • Adopt a Naming Convention:

    • The base file (e.g. browser-back.svg) will serve as the default.
    • Size-specific variants will be provided with dimensional suffixes (e.g. browser-back_32.svg, browser-back_16.svg).
  • Modify the Icon Generation Script:

    • Update gen-skia-icons.ts so that:
      • It excludes files with dimensional suffixes when gathering defaults.
      • When processing a default SVG, it searches for variant SVGs (based on the naming convention) and includes them in the generated .icon file.
      • Each variant is output as a separate representation with its own CANVAS_DIMENSIONS block.

This approach leverages the existing build pipeline and minimizes changes while providing the necessary multiple representations for crisp rendering across different display densities.

Additional Context:

  • This enhancement will help address reports of blurry vector icons on non-HDI displays.
  • It aligns Brave's icon generation with Chromium’s expectations, ensuring a better visual experience without overhauling the entire process.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions