Skip to content

Commit

Permalink
ci-test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Mar 14, 2024
1 parent 1287682 commit a7ae478
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/strip-font-data.pl
Original file line number Diff line number Diff line change
@@ -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);
}
6 changes: 1 addition & 5 deletions .github/workflows/strip-font-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7ae478

Please sign in to comment.