From 9ddbdcd304c23e4820770e963877d2b8ca714dbf Mon Sep 17 00:00:00 2001 From: Tim Deubler Date: Wed, 25 Oct 2023 17:40:52 +0200 Subject: [PATCH] fixed(display): In very rare cases, Chrome could cause text to be displayed offset. improved glyph creation performance Signed-off-by: Tim Deubler --- packages/display/src/displays/webgl/GlyphManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/display/src/displays/webgl/GlyphManager.ts b/packages/display/src/displays/webgl/GlyphManager.ts index e40390d3b..c6734985d 100644 --- a/packages/display/src/displays/webgl/GlyphManager.ts +++ b/packages/display/src/displays/webgl/GlyphManager.ts @@ -67,7 +67,7 @@ class GlyphManager { if (!fonts[styleId]) { const size = 96 * scale; const canvas = createCanvas(size, size); - const ctx = canvas.getContext('2d'); + const ctx = canvas.getContext('2d', {willReadFrequently: true}); ctx.textBaseline = 'bottom'; const letterHeightBottom = determineFontHeight(ctx, style, 'gM').height;