Skip to content

Commit

Permalink
Merge pull request #31 from itbencn/main
Browse files Browse the repository at this point in the history
Fix default font for Windows environment to support both English and Chinese
  • Loading branch information
dme-compunet authored Jan 7, 2024
2 parents 5aa9432 + 8697731 commit 8e7b8dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/YoloV8/Plotting/PlottingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public PlottingOptions()

private static FontFamily GetDefaultFontFamily()
{
if (OperatingSystem.IsWindows())
return SystemFonts.Get("Arial");
if (OperatingSystem.IsWindows() && SystemFonts.TryGet("Microsoft YaHei", out FontFamily family))
return family;

if (OperatingSystem.IsAndroid())
return SystemFonts.Get("Robot");
if (OperatingSystem.IsAndroid() && SystemFonts.TryGet("Robot", out family))
return family;

return SystemFonts.Families.First();
}
Expand Down

0 comments on commit 8e7b8dd

Please sign in to comment.