From c0d96cf6811e4e96245b9d06ea28572494ec4f5e Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 14 Apr 2024 22:56:02 +0200 Subject: element-web: use older emoji fonts thanks to networkException for demonstrating how to do this; I'd not have had the patience to figure out which files to replace otherwise. --- pkgs/overlay.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pkgs/overlay.nix') diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 15b059c..f40aac1 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -118,11 +118,25 @@ in element-web-unwrapped = super.element-web-unwrapped.overrideAttrs { patches = [ ./patches/element-css.patch ]; - # the below patches the javascript's assumptions about box height + # replace the emoji fonts with their older version, which i liked + # more. also patch the javascript's assumptions about box height # in the left side bar so that hiding overflow will work correctly # should be .mx_RoomTile's height + 12px # TODO: once --replace-fail is in stable use that instead - preBuild = '' + preBuild = let + TwemojiMozilla-colr = self.fetchurl { + url = "https://github.com/matrix-org/matrix-react-sdk/raw/a465b1659f1f7763a1a5afcd56b7aa8513c57342/res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2"; + hash = "sha256-TS2DTfotWc/C+7dKv9TYEnxognfTQ3/l8uPD5Ptozbs="; + }; + TwemojiMozilla-sbix = self.fetchurl { + url = "https://github.com/matrix-org/matrix-react-sdk/raw/a465b1659f1f7763a1a5afcd56b7aa8513c57342/res/fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.woff2"; + hash = "sha256-sbZGHcRiscCWrelyLQav6Q1a0x5RQInSNh/XwFlZHj8="; + }; + in '' + ln -sf ${TwemojiMozilla-colr} \ + node_modules/matrix-react-sdk/res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2 + ln -sf ${TwemojiMozilla-sbix} \ + node_modules/matrix-react-sdk/res/fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.woff2 substituteInPlace node_modules/matrix-react-sdk/src/stores/room-list/ListLayout.ts \ --replace "TILE_HEIGHT_PX = 44" "TILE_HEIGHT_PX = 32" ''; -- cgit v1.2.3