From a7ae4789d1946ee17620534596bebd451cc3eb7e Mon Sep 17 00:00:00 2001 From: bd_ Date: Thu, 14 Mar 2024 19:24:52 +0900 Subject: [PATCH] ci-test --- .github/strip-font-data.pl | 29 +++++++++++++++++++++++++++ .github/workflows/strip-font-data.yml | 6 +----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .github/strip-font-data.pl diff --git a/.github/strip-font-data.pl b/.github/strip-font-data.pl new file mode 100644 index 00000000..aee566cb --- /dev/null +++ b/.github/strip-font-data.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my $s = undef; + +my $w = 1024; +my $h = 1024; + +while(<>) { + if (defined($s) && !/^$s[ -]/) { undef $s; } + + if (/^\s+_typelessdata: /) { continue; } # Tex2D data + if (/^\s+m_AtlasWidth: (\d+)/) { $w = $1; } + if (/^\s+m_AtlasHeight: (\d+)/) { $h = $1; } + + if (/^([ \t]+)(m_GlyphTable:|m_CharacterTable:)/) { $s = $1; print "$1$2 []\n" } + if (/^([ \t]+)m_FreeGlyphRects:/) { + $s = $1; + print "$1m_FreeGlyphRects:\n"; + print "$1- m_X: 0\n"; + print "$1 m_Y: 0\n"; + print "$1 m_Width: ", $w - 1, "\n"; + print "$1 m_Height: ", $h - 1, "\n"; + } + + print if !defined($s); +} \ No newline at end of file diff --git a/.github/workflows/strip-font-data.yml b/.github/workflows/strip-font-data.yml index 94c4ff4a..8bd482eb 100644 --- a/.github/workflows/strip-font-data.yml +++ b/.github/workflows/strip-font-data.yml @@ -19,11 +19,7 @@ jobs: - run: | for font in $(find Editor/Fonts -name "*.asset"); do echo "Processing $font..." - cat "$font" | \ - grep -v "^ *_typelessdata: " | \ - perl -ne '$l = $_; if (defined($s) && !/^$s[ -]/) { undef $s; } if (/^([ \t]+)(m_GlyphTable:|m_FreeGlyphRects:|m_CharacterTable:)/) { $s = $1; print "$1$2 []\n" }; print $l if !defined($s);' \ - "$font" > "$font.tmp" - mv "$font.tmp" "$font" -fv + perl -p .github/strip-font-data.pl "$font" done - name: git diff