Skip to content

assets: replace meshviewer.woff2 icon font with SVG masks#355

Merged
skorpy2009 merged 1 commit intomainfrom
use_svgs
May 5, 2026
Merged

assets: replace meshviewer.woff2 icon font with SVG masks#355
skorpy2009 merged 1 commit intomainfrom
use_svgs

Conversation

@maurerle
Copy link
Copy Markdown
Member

@maurerle maurerle commented May 3, 2026

Description

Drops the icomoon-managed icon font (.woff2/.woff/.ttf) in favour of individual SVG files extracted from the original TTF. New icons can now be added by dropping an .svg into assets/icons/svg/ and registering it in icon.scss, removing the round-trip through icomoon.io.

Icons render via mask-image with background-color: currentColor, so existing font-size and color rules on .ion-* elements keep working unchanged. vertical-align matches the original font's value of 0 (baseline), so icon position relative to surrounding text is preserved.

Three SCSS modules (_sidebar, _leaflet, _table) used raw font codepoints inline; those are converted to a new icon.icon-mask($name) mixin.

Also drops three unused icon definitions (chevron-right, person, arrow-left-c) and the now-redundant $font-family-icons variable. DEVELOPMENT.md is updated to describe the new SVG workflow.

Motivation and Context

needed for #346 and general overhaul as the woff2 file is hard to patch and handle.

How Has This Been Tested?

visually using npm run dev

Screenshots/links:

Checklist:

  • My code follows the code style of this project. (CI will test it anyway and also needs approval)
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

@maurerle maurerle requested a review from skorpy2009 May 3, 2026 02:23
Copy link
Copy Markdown
Contributor

@grische grische left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maurerle I think all of your SVGs are not centered which them look a bit odd in comparison to the original font variant.
Just open two tabs, one with yours and one with upstream version and switch between them. It's quite noticeable.

There "will" be a few pixels deviations on how SVGs vs fonts are rendered, but not as pronounced as now.

Comment thread assets/icons/svg/chevron-left.svg
Comment thread assets/icons/svg/close.svg
Comment thread assets/icons/svg/full-enter.svg
Comment thread assets/icons/svg/full-exit.svg
Drops the icomoon-managed icon font (.woff2/.woff/.ttf) in favour of
individual SVG files extracted from the original TTF. New icons can now
be added by dropping an .svg into assets/icons/svg/ and registering it
in icon.scss, removing the round-trip through icomoon.io.

Icons render via mask-image with background-color: currentColor, so
existing font-size and color rules on .ion-* elements keep working
unchanged. vertical-align matches the original font's value of 0
(baseline), so icon position relative to surrounding text is preserved.

Three SCSS modules (_sidebar, _leaflet, _table) used raw font codepoints
inline; those are converted to a new icon.icon-mask($name) mixin.

Also drops three unused icon definitions (chevron-right, person,
arrow-left-c) and the now-redundant \$font-family-icons variable.
DEVELOPMENT.md is updated to describe the new SVG workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@skorpy2009 skorpy2009 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@skorpy2009 skorpy2009 merged commit 9bac645 into main May 5, 2026
2 checks passed
@skorpy2009 skorpy2009 deleted the use_svgs branch May 5, 2026 09:55
@grische
Copy link
Copy Markdown
Contributor

grische commented May 6, 2026

@maurerle the icons are still off-centered. I think particularly at the "full-enter.svg‎" it's very easy visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants