mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add support for specialised Thai font
This commit is contained in:
parent
4c1c7f61dc
commit
f083830c1e
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Bloxstrap.ico" />
|
<Resource Include="Bloxstrap.ico" />
|
||||||
|
<Resource Include="Resources\Fonts\NotoSansThai-VariableFont_wdth,wght.ttf" />
|
||||||
<Resource Include="Resources\Fonts\Rubik-VariableFont_wght.ttf" />
|
<Resource Include="Resources\Fonts\Rubik-VariableFont_wght.ttf" />
|
||||||
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoDark.jpg" />
|
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoDark.jpg" />
|
||||||
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoLight.jpg" />
|
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoLight.jpg" />
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Windows;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Bloxstrap.Resources;
|
using Bloxstrap.Resources;
|
||||||
|
|
||||||
namespace Bloxstrap
|
namespace Bloxstrap
|
||||||
@ -67,14 +63,16 @@ namespace Bloxstrap
|
|||||||
CultureInfo.DefaultThreadCurrentUICulture = App.CurrentCulture;
|
CultureInfo.DefaultThreadCurrentUICulture = App.CurrentCulture;
|
||||||
Thread.CurrentThread.CurrentUICulture = App.CurrentCulture;
|
Thread.CurrentThread.CurrentUICulture = App.CurrentCulture;
|
||||||
|
|
||||||
|
RoutedEventHandler? handler = null;
|
||||||
|
|
||||||
if (identifier == "ar" || identifier == "he")
|
if (identifier == "ar" || identifier == "he")
|
||||||
{
|
handler = new((window, _) => ((Window)window).FlowDirection = FlowDirection.RightToLeft);
|
||||||
// TODO: credit the SO post i took this from
|
else if (identifier == "th")
|
||||||
EventManager.RegisterClassHandler(typeof(Window), FrameworkElement.LoadedEvent, new RoutedEventHandler((window, _) =>
|
handler = new((window, _) => ((Window)window).FontFamily = new System.Windows.Media.FontFamily(new Uri("pack://application:,,,/Resources/Fonts/"), "./#Noto Sans Thai"));
|
||||||
{
|
|
||||||
((Window)window).FlowDirection = FlowDirection.RightToLeft;
|
// https://supportcenter.devexpress.com/ticket/details/t905790/is-there-a-way-to-set-right-to-left-mode-in-wpf-for-the-whole-application
|
||||||
}));
|
if (handler is not null)
|
||||||
}
|
EventManager.RegisterClassHandler(typeof(Window), FrameworkElement.LoadedEvent, handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user