Skip to content

Commit 0e0c1c0

Browse files
undeflnedCopilot
andauthored
Bugfix: Fontname not replace in vertical styles (#31)
* Bugfix: Vertical styles fontname not being replaced * Remove blank line * Update afs-cmd-ci.yml Co-authored-by: Ethan Zhang <admin@undeflned.xyz> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1f64e7d commit 0e0c1c0

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/afs-cmd-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
6161
- name: Setup Zig Compiler (target linux)
6262
if: matrix.config.target == 'linux-musl'
63-
uses: mlugg/setup-zig@v1
63+
uses: mlugg/setup-zig@v2.2.1
6464
with:
6565
version: "master"
6666

AssFontSubset.Core/src/SubsetCore.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,19 @@ where kv2.Key.FamilyNames.ContainsValue(kv.Key)
236236

237237
foreach (var style in ass.Styles.Collection)
238238
{
239-
if (assFontNameMap.TryGetValue(style.Fontname, out var newFn))
239+
if (style.Fontname.StartsWith('@'))
240240
{
241-
style.Fontname = newFn;
241+
if (assFontNameMap.TryGetValue(style.Fontname[1..], out var newFn))
242+
{
243+
style.Fontname = '@' + newFn;
244+
}
245+
}
246+
else
247+
{
248+
if (assFontNameMap.TryGetValue(style.Fontname, out var newFn))
249+
{
250+
style.Fontname = newFn;
251+
}
242252
}
243253
}
244254

0 commit comments

Comments
 (0)