Skip to content

Commit

Permalink
afs.core: subset keep vert, fix vertical layout
Browse files Browse the repository at this point in the history
  • Loading branch information
MIRIMIRIM committed Jul 19, 2024
1 parent 64a5701 commit 58eaa5f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion AssFontSubset.Core/src/PyFontTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,21 @@ private void ExecuteCmd(ProcessStartInfo startInfo)
private ProcessStartInfo GetSubsetCmd(SubsetFont ssf)
{
var startInfo = GetSimpleCmd(_pyftsubset);

// GDI doesn’t seem to use any features (may use vert?), and it has its own logic for handling vertical layout.
// https://github.com/libass/libass/pull/702
// libass seems to be trying to use features like vert/vrt2 to solve this problem.
// These are features related to vertical layout but are not enabled: "vchw", "vhal", "vkrn", "vpal", "vrtr". Maybe "vrt2" is also not used.
// https://github.com/libass/libass/blob/6e83137cdbaf4006439d526fef902e123129707b/libass/ass_shaper.c#L147
string[] enableFeatures = ["vert", "vrt2", "vkna"];
string[] argus = [
ssf.OriginalFontFile.FullName,
$"--text-file={ssf.CharactersFile!}",
$"--output-file={ssf.SubsetFontFileTemp!}",
"--name-languages=*",
$"--font-number={ssf.TrackIndex}",
"--no-layout-closure",
// "--no-layout-closure",
$"--layout-features='{string.Join(',', enableFeatures)}'"
];
foreach (var arg in argus)
{
Expand Down

0 comments on commit 58eaa5f

Please sign in to comment.