Skip to content

Commit

Permalink
afs.core: fix vertical assfont replacement error in ReplaceFontName
Browse files Browse the repository at this point in the history
  • Loading branch information
MIRIMIRIM committed Nov 9, 2024
1 parent 80704bf commit 7ae8c0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AssFontSubset.Core/src/SubsetByPyFT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,13 @@ private static bool ReplaceFontName(ReadOnlySpan<char> block, Dictionary<string,
var matched = false;
foreach (var (oldValue, newValue) in nameMap)
{
if (tagValue.SequenceEqual(oldValue))
var vertical = tagValue.Length > 1 && tagValue[0] == '@';
if (tagValue[(vertical ? 1 : 0)..].SequenceEqual(oldValue))
{
if (vertical)
{
sb.Append('@');
}
sb.Append(newValue);
changed = true;
matched = true;
Expand Down

0 comments on commit 7ae8c0c

Please sign in to comment.