fix(chartcuterie): Use Rubik font for rendered charts#118104
Draft
DominikB2014 wants to merge 1 commit into
Draft
fix(chartcuterie): Use Rubik font for rendered charts#118104DominikB2014 wants to merge 1 commit into
DominikB2014 wants to merge 1 commit into
Conversation
DEFAULT_FONT_FAMILY was hardcoded to 'sans-serif' as a temporary workaround in #31554 (2022) because the chartcuterie service wasn't loading fonts correctly at the time. The service now registers Rubik with node-canvas (registerCanvasFonts in getsentry/chartcuterie), so every chart was overriding an already-available Rubik back to the built-in fallback. Switch DEFAULT_FONT_FAMILY to 'Rubik' so timeseries, discover, performance, and all axis/legend labels render with the same typeface as the Sentry UI. Add an explicit FALLBACK_FONT_FAMILY for the metric alert/detector incident marker labels that intentionally avoid Rubik, preserving their current behavior. Fixes DAIN-1710
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chartcuterie-rendered charts (Slack unfurls, etc.) use
sans-serifinstead of Rubik, so they don't match the Sentry UI.DEFAULT_FONT_FAMILYwas hardcoded to'sans-serif'as a temporary workaround in #31554 (2022), back when the chartcuterie service wasn't loading fonts correctly. The service now registers Rubik with node-canvas (registerCanvasFontsingetsentry/chartcuterie,src/utils.ts, called at startup insrc/render.ts), so every config has been overriding an already-available Rubik back to the built-in fallback.Changes
slack.tsx:DEFAULT_FONT_FAMILY→'Rubik'. Flows into timeseries, discover, performance, and all axis/legend labels.FALLBACK_FONT_FAMILY = 'sans-serif'for the metric alert/detector incident marker labels that intentionally avoid Rubik — their behavior is unchanged.Notes
rubik-regular.woff/rubik-medium.woff). Non-Latin glyphs in labels fall back per-glyph to node-canvas's default — strictly no worse than today's all-sans-serif rendering, and likely the original reason the incident marker labels were pinned off Rubik.COMMIT_SHA) rolls out.Fixes DAIN-1710