forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SkiaTest: tweak for exception
- Loading branch information
Showing
4 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Drawing; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace MissionPlanner.plugins | ||
{ | ||
public class example22_fontsize : Plugin.Plugin | ||
{ | ||
public override string Name => "fontsize"; | ||
|
||
public override string Version => "0"; | ||
|
||
public override string Author => "me"; | ||
|
||
public override bool Exit() | ||
{ | ||
return true; | ||
} | ||
|
||
public override bool Init() | ||
{ | ||
Debugger.Break(); | ||
Console.WriteLine("Font name: " + SystemFonts.DefaultFont.Name); | ||
Console.WriteLine("Font size: " + SystemFonts.DefaultFont.Size); | ||
|
||
var s = TextRenderer.MeasureText("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", SystemFonts.DefaultFont); | ||
int width = (int)Math.Round((float)s.Width / 62f); | ||
|
||
Console.WriteLine(s + " " + width); | ||
|
||
Console.WriteLine("AutoScaleDimensions " + Host.MainForm.AutoScaleDimensions); | ||
Console.WriteLine("AutoScaleMode " + Host.MainForm.AutoScaleMode); | ||
return false; | ||
} | ||
|
||
public override bool Loaded() | ||
{ | ||
return false; | ||
} | ||
} | ||
} |