From 55edc0c9ab7936b1a86673521811d4e76478e759 Mon Sep 17 00:00:00 2001 From: XTigerHyperX Date: Sun, 11 Oct 2020 12:26:42 +0100 Subject: [PATCH 1/2] Revert "Improved and better Arabic Language support" This reverts commit 4977fdffbdc8ea272e82d274e9e4a0104efc3034. --- FModel/Properties/Resources.ar.resx | 1 - 1 file changed, 1 deletion(-) diff --git a/FModel/Properties/Resources.ar.resx b/FModel/Properties/Resources.ar.resx index 6106abcd..ea8bd936 100644 --- a/FModel/Properties/Resources.ar.resx +++ b/FModel/Properties/Resources.ar.resx @@ -427,7 +427,6 @@ It's now the most used free software to leak on Fortnite. الصور - تم حفظ الصورة بنجاح From cf2e2e8f5bcea6d8d9332800595110edb7a25d5b Mon Sep 17 00:00:00 2001 From: XTigerHyperX Date: Sun, 11 Oct 2020 15:04:04 +0100 Subject: [PATCH 2/2] pain (temp fix) --- FModel/Creator/Bases/BaseSeason.cs | 20 +++++++++++++++++++- FModel/Creator/Bundles/HeaderStyle.cs | 14 +++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/FModel/Creator/Bases/BaseSeason.cs b/FModel/Creator/Bases/BaseSeason.cs index 675e59ba..d9832ccc 100644 --- a/FModel/Creator/Bases/BaseSeason.cs +++ b/FModel/Creator/Bases/BaseSeason.cs @@ -6,6 +6,8 @@ using SkiaSharp; using SkiaSharp.HarfBuzz; using System; using System.Collections.Generic; +using System.Linq; +using System.Windows.Documents; namespace FModel.Creator.Bases { @@ -184,6 +186,7 @@ namespace FModel.Creator.Bases int x = 300; if ((ELanguage)Properties.Settings.Default.AssetsLanguage == ELanguage.Arabic) { + SKShaper shaper = new SKShaper(paint.Typeface); float shapedTextWidth; @@ -201,8 +204,22 @@ namespace FModel.Creator.Bases break; } } + if (text.Any(char.IsDigit)) + { + int s = text.Count(k => Char.IsDigit(k)); + + //Draw Number Separately + c.DrawShapedText(shaper, text.Substring(text.Length - s), x, 155, paint); + + c.DrawShapedText(shaper, text.Substring(0, text.Length - s), x + 60, 155, paint); + } + else + { + //feels bad man + c.DrawShapedText(shaper, text, x, 155, paint); + + } - c.DrawShapedText(shaper, text, x, 155, paint); } else { @@ -211,6 +228,7 @@ namespace FModel.Creator.Bases paint.TextSize -= 2; } c.DrawText(text, x, 155, paint); + } paint.Color = SKColors.White.WithAlpha(150); diff --git a/FModel/Creator/Bundles/HeaderStyle.cs b/FModel/Creator/Bundles/HeaderStyle.cs index 271b727d..039c977f 100644 --- a/FModel/Creator/Bundles/HeaderStyle.cs +++ b/FModel/Creator/Bundles/HeaderStyle.cs @@ -3,6 +3,7 @@ using FModel.Creator.Texts; using SkiaSharp; using SkiaSharp.HarfBuzz; using System; +using System.Linq; namespace FModel.Creator.Bundles { @@ -95,8 +96,19 @@ namespace FModel.Creator.Bundles break; } } + if (text.Any(char.IsDigit)) + { + int s = text.Count(k => Char.IsDigit(k)); + c.DrawShapedText(shaper, text.Substring(text.Length - s), x, 155, paint); - c.DrawShapedText(shaper, text, x, 155, paint); + c.DrawShapedText(shaper, text.Substring(0, text.Length - s), x + 60, 155, paint); + } + else + { + //feels bad man + c.DrawShapedText(shaper, text, x, 155, paint); + + } } else {