font=-fx-font-size:36px;-fx-font-smoothing-type: lcd;-fx-text-fill: blue;-fx-font-family: "Comic Sans MS";-fx-stroke: black;
label.setFont(Font.font("System", FontWeight.NORMAL, (double) 30.0));
String style = properties.getProperty("font");
if (style != null) {
System.err.println("Applying style : " + style);
label.setStyle(style);
}
System.err.println(
"Reading the font information: " + label.getFont().toString()); - will not change
// Reading the font information: Font[name=System Regular, family=System,
// style=Regular, size=30.0]
// TODO: convert
System.err.println(
"Reading the style information: " + label.getStyle().toString());
// will output the same style as was set:
Reading the style information: -fx-font-size:36px;-fx-font-smoothing-type: lcd;-
fx-text-fill: blue;-fx-font-family: "Comic Sans MS";-fx-stroke: black;
add-type -typeDefinition @"
// https://www.codeproject.com/Tips/394460/Download-File-Using-Csharp
// https://docs.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadfile?view=netframework-4.5.1#System_Net_WebClient_DownloadFile_System_Uri_System_String_
using System.Net;
using System;
using System.Windows.Forms;
public class Test {
public static void m() {
string url = @"http://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png";
WebClient client = new WebClient();
client.DownloadFile(new Uri(url), @"c:\temp\wikipedia-logo.png");
}
}
"@ -referencedAssemblies 'System.net', 'System.Windows.Forms'
[Test]::m()