From 402ed644fcb2ff266a9cb7a0a526f1b4aeb4ed32 Mon Sep 17 00:00:00 2001 From: Mike Nye Date: Mon, 23 Feb 2026 11:36:03 +0800 Subject: [PATCH 1/2] Helper script to build full set of material icons as msdf --- build_material_icons.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 build_material_icons.sh diff --git a/build_material_icons.sh b/build_material_icons.sh new file mode 100755 index 0000000..4a21ee8 --- /dev/null +++ b/build_material_icons.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -oe pipefail + +# get repository root directory on local system +REPO_ROOT="$(git rev-parse --show-superproject-working-tree)" + +# define working directory +WORK_DIR="$REPO_ROOT"/tools/content_tools/MaterialIcons + +# make directory for Material Icons font building +echo "Create working directory: $WORK_DIR" +mkdir -p "$WORK_DIR" + +# download font and codepoints +MA_CODEPOINTS_FILE="https://github.com/google/material-design-icons/raw/refs/heads/master/font/MaterialIcons-Regular.codepoints" +echo "Downloading: $MA_CODEPOINTS_FILE ..." +curl -sLo "$WORK_DIR/MaterialIcons-Regular.codepoints" "$MA_CODEPOINTS_FILE" + +MA_TTF_FILE="https://github.com/google/material-design-icons/raw/refs/heads/master/font/MaterialIcons-Regular.ttf" +echo "Downloading: $MA_TTF_FILE ..." +curl -sLo "$WORK_DIR/MaterialIcons-Regular.ttf" "$MA_TTF_FILE" + +# extract all character codes from codepoints +echo "Extracting all character codes from codepoints file..." +awk '{ print "0x" toupper($2) }' "$WORK_DIR/MaterialIcons-Regular.codepoints" > "$WORK_DIR/charset.txt" + +# generate msdf +echo "Generating MSDF..." +cd "$REPO_ROOT"/src +go run generators/msdf/main.go MaterialIcons + +# copy output +echo "Copying output files..." +cp -v "$WORK_DIR/out/MaterialIcons-Regular.bin" "$REPO_ROOT/src/editor/editor_embedded_content/editor_content/fonts/MaterialIcons-Regular.bin" +cp -v "$WORK_DIR/out/MaterialIcons-Regular.png" "$REPO_ROOT/src/editor/editor_embedded_content/editor_content/fonts/MaterialIcons-Regular.png" +cp -v "$WORK_DIR/charset.txt" "$REPO_ROOT/src/editor/editor_embedded_content/editor_content/fonts/MaterialIcons-Regular.charset.txt" + +# clean up +echo "Cleaning up..." +rm -vr "$WORK_DIR" \ No newline at end of file From b215da8e757d846ec50b868b0ca92c7ad5f8c34a Mon Sep 17 00:00:00 2001 From: Mike Nye Date: Mon, 23 Feb 2026 11:43:42 +0800 Subject: [PATCH 2/2] ensure script works when called from different directory --- build_material_icons.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build_material_icons.sh b/build_material_icons.sh index 4a21ee8..f25c6bc 100755 --- a/build_material_icons.sh +++ b/build_material_icons.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash -set -oe pipefail +set -euo pipefail + +# cd into script dir +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +cd "$SCRIPT_DIR" # get repository root directory on local system REPO_ROOT="$(git rev-parse --show-superproject-working-tree)"