├── .editorconfig ├── .gitignore ├── FontLink Settings.sln ├── FontLink Settings ├── App.config ├── App.xaml ├── App.xaml.cs ├── FallbackTemplateSelector.cs ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── FontLink Settings.csproj ├── FontLinkFallback.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ └── App.ico └── Utilities │ └── SecurityHelpers.cs ├── License.txt └── ReadMe.md /.editorconfig: -------------------------------------------------------------------------------- 1 | # Remove the line below if you want to inherit .editorconfig settings from higher directories 2 | root = true 3 | 4 | # C# files 5 | [*.cs] 6 | 7 | #### Core EditorConfig Options #### 8 | 9 | # Indentation and spacing 10 | indent_size = 4 11 | indent_style = space 12 | tab_width = 4 13 | 14 | # New line preferences 15 | end_of_line = crlf 16 | insert_final_newline = true 17 | 18 | #### .NET Coding Conventions #### 19 | 20 | # this. and Me. preferences 21 | dotnet_style_qualification_for_event = false:silent 22 | dotnet_style_qualification_for_field = false:silent 23 | dotnet_style_qualification_for_method = false:silent 24 | dotnet_style_qualification_for_property = false:silent 25 | 26 | # Language keywords vs BCL types preferences 27 | dotnet_style_predefined_type_for_locals_parameters_members = false:silent 28 | dotnet_style_predefined_type_for_member_access = false:suggestion 29 | 30 | # Parentheses preferences 31 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion 32 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion 33 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion 34 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion 35 | 36 | # Modifier preferences 37 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent 38 | 39 | # Expression-level preferences 40 | csharp_style_deconstructed_variable_declaration = true:suggestion 41 | csharp_style_inlined_variable_declaration = true:suggestion 42 | csharp_style_throw_expression = true:suggestion 43 | dotnet_style_coalesce_expression = true:suggestion 44 | dotnet_style_collection_initializer = true:suggestion 45 | dotnet_style_explicit_tuple_names = true:suggestion 46 | dotnet_style_null_propagation = true:suggestion 47 | dotnet_style_object_initializer = true:suggestion 48 | dotnet_style_prefer_auto_properties = true:silent 49 | dotnet_style_prefer_compound_assignment = true:suggestion 50 | dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion 51 | dotnet_style_prefer_conditional_expression_over_return = true:suggestion 52 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion 53 | dotnet_style_prefer_inferred_tuple_names = true:suggestion 54 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion 55 | 56 | # Field preferences 57 | dotnet_style_readonly_field = true:suggestion 58 | 59 | # Parameter preferences 60 | dotnet_code_quality_unused_parameters = all:suggestion 61 | 62 | #### C# Coding Conventions #### 63 | 64 | # var preferences 65 | csharp_style_var_elsewhere = true:silent 66 | csharp_style_var_for_built_in_types = true:silent 67 | csharp_style_var_when_type_is_apparent = true:suggestion 68 | 69 | # Expression-bodied members 70 | csharp_style_expression_bodied_accessors = when_on_single_line:silent 71 | csharp_style_expression_bodied_constructors = when_on_single_line:silent 72 | csharp_style_expression_bodied_indexers = when_on_single_line:silent 73 | csharp_style_expression_bodied_lambdas = when_on_single_line:silent 74 | csharp_style_expression_bodied_local_functions = when_on_single_line:silent 75 | csharp_style_expression_bodied_methods = when_on_single_line:silent 76 | csharp_style_expression_bodied_operators = when_on_single_line:silent 77 | csharp_style_expression_bodied_properties = when_on_single_line:silent 78 | 79 | # Pattern matching preferences 80 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion 81 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion 82 | 83 | # Null-checking preferences 84 | csharp_style_conditional_delegate_call = true:suggestion 85 | 86 | # Modifier preferences 87 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async 88 | 89 | # Code-block preferences 90 | csharp_prefer_braces = true:silent 91 | 92 | # Expression-level preferences 93 | csharp_prefer_simple_default_expression = true:suggestion 94 | csharp_style_pattern_local_over_anonymous_function = true:suggestion 95 | csharp_style_prefer_index_operator = true:suggestion 96 | csharp_style_prefer_range_operator = true:suggestion 97 | csharp_style_unused_value_assignment_preference = discard_variable:suggestion 98 | csharp_style_unused_value_expression_statement_preference = discard_variable:silent 99 | 100 | #### C# Formatting Rules #### 101 | 102 | # New line preferences 103 | csharp_new_line_before_catch = true 104 | csharp_new_line_before_else = true 105 | csharp_new_line_before_finally = true 106 | csharp_new_line_before_members_in_anonymous_types = true 107 | csharp_new_line_before_members_in_object_initializers = true 108 | csharp_new_line_before_open_brace = all 109 | csharp_new_line_between_query_expression_clauses = true 110 | 111 | # Indentation preferences 112 | csharp_indent_block_contents = true 113 | csharp_indent_braces = false 114 | csharp_indent_case_contents = true 115 | csharp_indent_case_contents_when_block = false 116 | csharp_indent_labels = one_less_than_current 117 | csharp_indent_switch_labels = false 118 | 119 | # Space preferences 120 | csharp_space_after_cast = true 121 | csharp_space_after_colon_in_inheritance_clause = true 122 | csharp_space_after_comma = true 123 | csharp_space_after_dot = false 124 | csharp_space_after_keywords_in_control_flow_statements = true 125 | csharp_space_after_semicolon_in_for_statement = true 126 | csharp_space_around_binary_operators = before_and_after 127 | csharp_space_around_declaration_statements = false 128 | csharp_space_before_colon_in_inheritance_clause = true 129 | csharp_space_before_comma = false 130 | csharp_space_before_dot = false 131 | csharp_space_before_open_square_brackets = false 132 | csharp_space_before_semicolon_in_for_statement = false 133 | csharp_space_between_empty_square_brackets = false 134 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 135 | csharp_space_between_method_call_name_and_opening_parenthesis = false 136 | csharp_space_between_method_call_parameter_list_parentheses = false 137 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 138 | csharp_space_between_method_declaration_name_and_open_parenthesis = false 139 | csharp_space_between_method_declaration_parameter_list_parentheses = false 140 | csharp_space_between_parentheses = false 141 | csharp_space_between_square_brackets = false 142 | 143 | # Wrapping preferences 144 | csharp_preserve_single_line_blocks = true 145 | csharp_preserve_single_line_statements = false 146 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific files 2 | .vs/ 3 | *.suo 4 | *.user 5 | *.sln.docstates 6 | 7 | # Build results 8 | [Dd]ebug/ 9 | [Rr]elease/ 10 | x64/ 11 | build/ 12 | [Bb]in/ 13 | [Oo]bj/ 14 | 15 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 16 | !packages/*/build/ 17 | 18 | # MSTest test Results 19 | [Tt]est[Rr]esult*/ 20 | [Bb]uild[Ll]og.* 21 | 22 | *_i.c 23 | *_p.c 24 | *.ilk 25 | *.meta 26 | *.obj 27 | *.pch 28 | *.pdb 29 | *.pgc 30 | *.pgd 31 | *.rsp 32 | *.sbr 33 | *.tlb 34 | *.tli 35 | *.tlh 36 | *.tmp 37 | *.tmp_proj 38 | *.log 39 | *.vspscc 40 | *.vssscc 41 | .builds 42 | *.pidb 43 | *.log 44 | *.scc 45 | 46 | # Visual C++ cache files 47 | ipch/ 48 | *.aps 49 | *.ncb 50 | *.opensdf 51 | *.sdf 52 | *.cachefile 53 | 54 | # Visual Studio profiler 55 | *.psess 56 | *.vsp 57 | *.vspx 58 | 59 | # Guidance Automation Toolkit 60 | *.gpState 61 | 62 | # ReSharper is a .NET coding add-in 63 | _ReSharper*/ 64 | *.[Rr]e[Ss]harper 65 | 66 | # TeamCity is a build add-in 67 | _TeamCity* 68 | 69 | # DotCover is a Code Coverage Tool 70 | *.dotCover 71 | 72 | # NCrunch 73 | *.ncrunch* 74 | .*crunch*.local.xml 75 | 76 | # Installshield output folder 77 | [Ee]xpress/ 78 | 79 | # DocProject is a documentation generator add-in 80 | DocProject/buildhelp/ 81 | DocProject/Help/*.HxT 82 | DocProject/Help/*.HxC 83 | DocProject/Help/*.hhc 84 | DocProject/Help/*.hhk 85 | DocProject/Help/*.hhp 86 | DocProject/Help/Html2 87 | DocProject/Help/html 88 | 89 | # Click-Once directory 90 | publish/ 91 | 92 | # Publish Web Output 93 | *.Publish.xml 94 | *.pubxml 95 | 96 | # NuGet Packages Directory 97 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 98 | packages/ 99 | lib/ 100 | !NuGet.exe 101 | 102 | # Windows Azure Build Output 103 | csx 104 | *.build.csdef 105 | 106 | # Windows Store app package directory 107 | AppPackages/ 108 | 109 | # Others 110 | sql/ 111 | *.Cache 112 | ClientBin/ 113 | [Ss]tyle[Cc]op.* 114 | ~$* 115 | *~ 116 | *.dbmdl 117 | *.[Pp]ublish.xml 118 | *.pfx 119 | *.publishsettings 120 | *.nupkg 121 | project.lock.json 122 | 123 | # RIA/Silverlight projects 124 | Generated_Code/ 125 | 126 | # Backup & report files from converting an old project file to a newer 127 | # Visual Studio version. Backup files are not needed, because we have git ;-) 128 | _UpgradeReport_Files/ 129 | Backup*/ 130 | UpgradeLog*.XML 131 | UpgradeLog*.htm 132 | 133 | # SQL Server files 134 | App_Data/*.mdf 135 | App_Data/*.ldf 136 | 137 | # Windows image file caches 138 | Thumbs.db 139 | ehthumbs.db 140 | 141 | # Folder config file 142 | Desktop.ini 143 | 144 | # Recycle Bin used on file shares 145 | $RECYCLE.BIN/ 146 | 147 | # Mac crap 148 | .DS_Store 149 | -------------------------------------------------------------------------------- /FontLink Settings.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.421 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontLink Settings", "FontLink Settings\FontLink Settings.csproj", "{5040C250-CC53-4C39-93AA-913B1BF723F6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5040C250-CC53-4C39-93AA-913B1BF723F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5040C250-CC53-4C39-93AA-913B1BF723F6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5040C250-CC53-4C39-93AA-913B1BF723F6}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5040C250-CC53-4C39-93AA-913B1BF723F6}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {255B3250-81B3-491E-BC52-FC39818B7F19} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /FontLink Settings/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FontLink Settings/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /FontLink Settings/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace FontLinkSettings 10 | { 11 | public partial class App : Application 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /FontLink Settings/FallbackTemplateSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | 5 | namespace FontLinkSettings 6 | { 7 | internal class FallbackTemplateSelector : DataTemplateSelector 8 | { 9 | public override DataTemplate SelectTemplate(Object item, DependencyObject container) 10 | { 11 | if (container is FrameworkElement root && 12 | item is FontLinkFallback fallback) 13 | { 14 | if (fallback.GDISize == 0 && fallback.DirectXSize == 0) 15 | { 16 | return root.FindResource("Fallback") as DataTemplate; 17 | } 18 | 19 | return root.FindResource("FallbackWithSizes") as DataTemplate; 20 | } 21 | 22 | return null; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /FontLink Settings/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /FontLink Settings/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks 13 | 14 | 15 | 16 | 17 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. 18 | 19 | 20 | 21 | 22 | A list of unmanaged 32 bit assembly names to include, delimited with line breaks. 23 | 24 | 25 | 26 | 27 | A list of unmanaged 64 bit assembly names to include, delimited with line breaks. 28 | 29 | 30 | 31 | 32 | The order of preloaded assemblies, delimited with line breaks. 33 | 34 | 35 | 36 | 37 | 38 | This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. 39 | 40 | 41 | 42 | 43 | Controls if .pdbs for reference assemblies are also embedded. 44 | 45 | 46 | 47 | 48 | Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. 49 | 50 | 51 | 52 | 53 | As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. 54 | 55 | 56 | 57 | 58 | Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. 59 | 60 | 61 | 62 | 63 | Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. 64 | 65 | 66 | 67 | 68 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | 69 | 70 | 71 | 72 | 73 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. 74 | 75 | 76 | 77 | 78 | A list of unmanaged 32 bit assembly names to include, delimited with |. 79 | 80 | 81 | 82 | 83 | A list of unmanaged 64 bit assembly names to include, delimited with |. 84 | 85 | 86 | 87 | 88 | The order of preloaded assemblies, delimited with |. 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 97 | 98 | 99 | 100 | 101 | A comma-separated list of error codes that can be safely ignored in assembly verification. 102 | 103 | 104 | 105 | 106 | 'false' to turn off automatic generation of the XML Schema file. 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /FontLink Settings/FontLink Settings.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5040C250-CC53-4C39-93AA-913B1BF723F6} 8 | WinExe 9 | FontLinkSettings 10 | FontLink Settings 11 | v4.7.2 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | true 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | false 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | 35 | 36 | prompt 37 | 4 38 | false 39 | 40 | 41 | Resources\App.ico 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 4.0 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | MSBuild:Compile 64 | Designer 65 | 66 | 67 | 68 | MSBuild:Compile 69 | Designer 70 | 71 | 72 | App.xaml 73 | Code 74 | 75 | 76 | 77 | 78 | MainWindow.xaml 79 | Code 80 | 81 | 82 | 83 | 84 | Code 85 | 86 | 87 | True 88 | True 89 | Resources.resx 90 | 91 | 92 | True 93 | Settings.settings 94 | True 95 | 96 | 97 | PublicResXFileCodeGenerator 98 | Resources.Designer.cs 99 | 100 | 101 | SettingsSingleFileGenerator 102 | Settings.Designer.cs 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 3.3.2 111 | 112 | 113 | 1.1.0 114 | 115 | 116 | 2.6.3 117 | runtime; build; native; contentfiles; analyzers 118 | all 119 | 120 | 121 | 1.0.0 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /FontLink Settings/FontLinkFallback.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FontLinkSettings 4 | { 5 | internal class FontLinkFallback 6 | { 7 | public String Typeface { get; set; } 8 | public String Collection { get; set; } 9 | public Int32 GDISize { get; set; } 10 | public Int32 DirectXSize { get; set; } 11 | 12 | public override String ToString() 13 | { 14 | return $"{Typeface} ({Collection})"; 15 | } 16 | 17 | public String GDISizeString => $"GDI Size: {GDISize}"; 18 | public String DirectXSizeString => $"Direct2D Size: {DirectXSize}"; 19 | 20 | public String ExportString 21 | { 22 | get 23 | { 24 | if (GDISize == 0 || DirectXSize == 0) 25 | { 26 | return $"{Collection},{Typeface}"; 27 | } 28 | 29 | return $"{Collection},{Typeface},{GDISize},{DirectXSize}"; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /FontLink Settings/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  18 | 19 | 21 | 22 | 24 | 26 | 28 | 30 | 32 | 33 | 34 | 35 | 37 | 38 | 41 | 42 | 43 | 45 | 46 | 47 | 49 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 71 | 72 | 73 | 75 | 76 | 77 |