IReadOnlyList <DevOption> Inflate() { var v = Options.Variant; var c = Character; bool hasSymbol = FontFinder.IsSystemSymbolFamily(v) && Enum.IsDefined(typeof(Symbol), (int)c.UnicodeIndex); string hex = c.UnicodeIndex.ToString("x4").ToUpper(); string pathIconData = GetOutlineGeometry(c, Options); string fontIcon = $"auto f = ref new FontIcon();\n" + $"f->FontFamily = ref new Media::FontFamily(L\"{v?.XamlFontSource}\");\n" + $"f->Glyph = L\"\\u{hex}\";"; var ops = new List <DevOption>() { new ("TxtXamlCode/Header", c.UnicodeIndex > 0xFFFF ? $"\\U{c.UnicodeIndex:x8}".ToUpper() : $"\\u{hex}"), new ("TxtFontIcon/Header", fontIcon, true), }; if (!string.IsNullOrWhiteSpace(pathIconData)) { var data = $"auto p = ref new PathIcon();\n" + "p->VerticalAlignment = Windows::UI::Xaml::VerticalAlignment::Center;\n" + "p->HorizontalAlignment = Windows::UI::Xaml::HorizontalAlignment::Center;\n" + $"p->Data = (Geometry^)Markup::XamlBindingHelper::ConvertValue(Geometry::typeid, L\"{pathIconData}\");"; ops.Add(new DevOption("TxtPathIcon/Text", data, true, true)); } if (hasSymbol) { ops.Add(new DevOption("TxtSymbolIcon/Header", $"ref new SymbolIcon(Symbol::{(Symbol)c.UnicodeIndex});")); } return(ops); }
IReadOnlyList <DevOption> Inflate() { var v = Options.Variant; var c = Character; bool hasSymbol = FontFinder.IsSystemSymbolFamily(v) && Enum.IsDefined(typeof(Symbol), (int)c.UnicodeIndex); var hex = c.UnicodeIndex.ToString("x4").ToUpper(); string pathIconData = GetOutlineGeometry(c, Options); string glyph = c.UnicodeIndex > 0xFFFF ? $"ChrW(&H{$"{c.UnicodeIndex:x8}".ToUpper()})" : $"ChrW(&H{hex})"; var ops = new List <DevOption>() { new ("TxtXamlCode/Header", glyph), new ("TxtFontIcon/Header", $"New FontIcon With {{ .FontFamily = New Windows.UI.Xaml.Media.FontFamily(\"{v?.XamlFontSource}\"), .Glyph = {glyph} }}"), }; if (!string.IsNullOrWhiteSpace(pathIconData)) { ops.Add(new DevOption("TxtPathIcon/Text", $"New PathIcon With {{.Data = TryCast(Windows.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(GetType(Windows.UI.Xaml.Media.Geometry), \"{pathIconData}\"), Windows.UI.Xaml.Media.Geometry), .HorizontalAlignment = HorizontalAlignment.Center, .VerticalAlignment = VerticalAlignment.Center}}", supportsTypography: true)); } if (hasSymbol) { ops.Add(new DevOption("TxtSymbolIcon/Header", $"New SymbolIcon With {{ .Symbol = Symbol.{(Symbol)c.UnicodeIndex} }}")); } return(ops); }
IReadOnlyList <DevOption> Inflate() { var v = Options.Variant; var c = Character; bool hasSymbol = FontFinder.IsSystemSymbolFamily(v) && Enum.IsDefined(typeof(Symbol), (int)c.UnicodeIndex); var hex = c.UnicodeIndex.ToString("x4").ToUpper(); string pathIconData = GetOutlineGeometry(c, Options); var ops = new List <DevOption>() { new ("TxtXamlCode/Header", $"&#x{hex};"), new ("TxtFontIcon/Header", $@"<FontIcon FontFamily=""{GetFontSource(v?.XamlFontSource)}"" Glyph=""&#x{hex};"" />", supportsTypography : true), }; if (!string.IsNullOrWhiteSpace(pathIconData)) { ops.Add(new DevOption("TxtPathIcon/Text", $"<PathIcon Data=\"{pathIconData}\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" />", supportsTypography: true)); } if (hasSymbol) { ops.Add(new DevOption("TxtSymbolIcon/Header", $@"<SymbolIcon Symbol=""{(Symbol)c.UnicodeIndex}"" />")); } return(ops); }
IReadOnlyList <DevOption> Inflate() { var v = Options.Variant; var c = Character; bool hasSymbol = FontFinder.IsSystemSymbolFamily(v) && Enum.IsDefined(typeof(Symbol), (int)c.UnicodeIndex); var hex = c.UnicodeIndex.ToString("x4").ToUpper(); string pathIconData = GetOutlineGeometry(c, Options); var ops = new List <DevOption>() { new ("TxtXamlCode/Header", c.UnicodeIndex > 0xFFFF ? $"\\U{c.UnicodeIndex:x8}".ToUpper() : $"\\u{hex}"), new ("TxtFontIcon/Header", $"new FontIcon {{ FontFamily = new {Namespace}.UI.Xaml.Media.FontFamily(\"{v?.XamlFontSource}\") , Glyph = \"\\u{hex}\" }};"), }; if (!string.IsNullOrWhiteSpace(pathIconData)) { ops.Add(new DevOption("TxtPathIcon/Text", $"new PathIcon {{ Data = ({Namespace}.UI.Xaml.Media.Geometry){Namespace}.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof({Namespace}.UI.Xaml.Media.Geometry), \"{pathIconData}\"), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }};", supportsTypography: true)); } if (hasSymbol) { ops.Add(new DevOption("TxtSymbolIcon/Header", $"new SymbolIcon {{ Symbol = Symbol.{(Symbol)c.UnicodeIndex} }};")); } return(ops); }
IReadOnlyList <DevOption> Inflate() { var v = Options.Variant; var c = Character; bool hasSymbol = FontFinder.IsSystemSymbolFamily(v) && Enum.IsDefined(typeof(Symbol), (int)c.UnicodeIndex); string hex = c.UnicodeIndex.ToString("x4").ToUpper(); string pathIconData = GetOutlineGeometry(c, Options); string fontIcon = "// Add \"#include <winrt/Windows.UI.Xaml.Media.h>\" to pch.h\n" + "auto f = FontIcon();\n" + $"f.Glyph(L\"\\u{hex}\");\n" + $"f.FontFamily(Media::FontFamily(L\"{v?.XamlFontSource}\"));"; var ops = new List <DevOption>() { new ("TxtXamlCode/Header", c.UnicodeIndex > 0xFFFF ? $"\\U{c.UnicodeIndex:x8}".ToUpper() : $"\\u{hex}"), new ("TxtFontIcon/Header", fontIcon, true), }; if (!string.IsNullOrWhiteSpace(pathIconData)) { var data = $"// Add \"#include <winrt/Windows.UI.Xaml.Media.h>\" to pch.h\n" + $"auto p = PathIcon();\n" + $"p.VerticalAlignment(VerticalAlignment::Center);\n" + $"p.HorizontalAlignment(HorizontalAlignment::Center);\n" + $"p.Data(Markup::XamlBindingHelper::ConvertValue(winrt::xaml_typename<Geometry>(), box_value(L\"{pathIconData}\")).try_as<Geometry>());"; ops.Add(new DevOption("TxtPathIcon/Text", data, true, true)); } if (hasSymbol) { ops.Add(new DevOption("TxtSymbolIcon/Header", $"SymbolIcon(Symbol::{(Symbol)c.UnicodeIndex});")); } return(ops); }