From df4a56f39b5e3120b2ffcd6993e9e7555ead7c83 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 15 Sep 2023 18:27:27 +1000 Subject: [PATCH] Only apply swap for non-horizontal layout --- src/SixLabors.Fonts/TextLayout.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SixLabors.Fonts/TextLayout.cs b/src/SixLabors.Fonts/TextLayout.cs index 6f5a4648..7cf6552f 100644 --- a/src/SixLabors.Fonts/TextLayout.cs +++ b/src/SixLabors.Fonts/TextLayout.cs @@ -825,6 +825,11 @@ private static void SubstituteBidiMirrors(FontMetrics fontMetrics, GlyphSubstitu // TODO: This only replaces certain glyphs. We should investigate the specification further. // https://www.unicode.org/reports/tr50/#vertical_alternates + if (collection.TextOptions.LayoutMode.IsHorizontal()) + { + return; + } + for (int i = 0; i < collection.Count; i++) { GlyphShapingData data = collection[i];