mirror of
https://github.com/2dust/v2rayN.git
synced 2026-05-30 01:34:08 +00:00
Fix the problem of font select (#9405)
Some checks are pending
release Linux / build (push) Waiting to run
release Linux / release-zip (push) Blocked by required conditions
release Linux / build and release deb x64 & arm64 (push) Waiting to run
release Linux / build and release rpm x64 & arm64 (push) Waiting to run
release Linux / build and release rpm riscv64 (push) Waiting to run
release Linux / build and release deb riscv64 (push) Waiting to run
release Linux / build and release deb loong64 (push) Waiting to run
release macOS / build (push) Waiting to run
release macOS / release-zip (push) Blocked by required conditions
release macOS / package and release macOS dmg (push) Blocked by required conditions
release Windows desktop (Avalonia UI) / build (push) Waiting to run
release Windows desktop (Avalonia UI) / release-zip (push) Blocked by required conditions
release Windows / build (push) Waiting to run
release Windows / release-zip (push) Blocked by required conditions
Some checks are pending
release Linux / build (push) Waiting to run
release Linux / release-zip (push) Blocked by required conditions
release Linux / build and release deb x64 & arm64 (push) Waiting to run
release Linux / build and release rpm x64 & arm64 (push) Waiting to run
release Linux / build and release rpm riscv64 (push) Waiting to run
release Linux / build and release deb riscv64 (push) Waiting to run
release Linux / build and release deb loong64 (push) Waiting to run
release macOS / build (push) Waiting to run
release macOS / release-zip (push) Blocked by required conditions
release macOS / package and release macOS dmg (push) Blocked by required conditions
release Windows desktop (Avalonia UI) / build (push) Waiting to run
release Windows desktop (Avalonia UI) / release-zip (push) Blocked by required conditions
release Windows / build (push) Waiting to run
release Windows / release-zip (push) Blocked by required conditions
* Update OptionSettingWindow.axaml.cs * Update OptionSettingWindow.axaml.cs
This commit is contained in:
parent
3448782925
commit
1d2442d58a
1 changed files with 9 additions and 20 deletions
|
|
@ -161,29 +161,18 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
||||||
|
|
||||||
private async Task<List<string>> GetFonts()
|
private async Task<List<string>> GetFonts()
|
||||||
{
|
{
|
||||||
|
await Task.CompletedTask;
|
||||||
|
|
||||||
var lstFonts = new List<string>();
|
var lstFonts = new List<string>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Utils.IsWindows())
|
var lst = Avalonia.Media.FontManager.Current.SystemFonts
|
||||||
{
|
.Select(t => t.Name)
|
||||||
return lstFonts;
|
.Where(t => t.IsNotEmpty())
|
||||||
}
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
else if (Utils.IsNonWindows())
|
.OrderBy(t => t)
|
||||||
{
|
.ToList();
|
||||||
var result = await Utils.GetLinuxFontFamily("zh");
|
return lst;
|
||||||
if (result.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
return lstFonts;
|
|
||||||
}
|
|
||||||
|
|
||||||
var lst = result.Split(Environment.NewLine)
|
|
||||||
.Where(t => t.IsNotEmpty())
|
|
||||||
.ToList()
|
|
||||||
.Select(t => t.Split(",").FirstOrDefault() ?? "")
|
|
||||||
.OrderBy(t => t)
|
|
||||||
.ToList();
|
|
||||||
return lst;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue