<commit_before>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Text;

namespace TQVaultAE.Presentation
{
	public static class FontHelper
	{
		public static IAddFontToOS FontLoader { get; set; }

		private static FontFamily _FONT_ALBERTUSMT = new FontFamily("Albertus MT");
		internal static FontFamily FONT_ALBERTUSMT
		{
			get
			{
				if (FontLoader != null) _FONT_ALBERTUSMT = FontLoader.AddFontToOS(Resources.AlbertusMT);// Runtime
				return _FONT_ALBERTUSMT;
			}
		}

		private static FontFamily _FONT_ALBERTUSMTLIGHT = new FontFamily("Albertus MT Light");
		internal static FontFamily FONT_ALBERTUSMTLIGHT
		{
			get
			{
				if (FontLoader != null) _FONT_ALBERTUSMTLIGHT = FontLoader.AddFontToOS(Resources.AlbertusMTLight);// Runtime
				return _FONT_ALBERTUSMTLIGHT;
			}<commit_msg>Fix font error on static init + Fallback to Times New Roman at design time<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Text;

namespace TQVaultAE.Presentation
{
	public static class FontHelper
	{
		public static IAddFontToOS FontLoader { get; set; }

		private static FontFamily _FONT_ALBERTUSMT = null;
		internal static FontFamily FONT_ALBERTUSMT
		{
			get
			{
				if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
				{
					// Code here won't run in Visual Studio designer
					if (FontLoader != null && _FONT_ALBERTUSMT is null) _FONT_ALBERTUSMT = FontLoader.AddFontToOS(Resources.AlbertusMT);// Runtime
				}
				else
				{
					// Design time
					if (_FONT_ALBERTUSMT is null)
					{
						try
						{
							_FONT_ALBERTUSMT = new FontFamily("Albertus MT");
						}
						catch
						{ // fallback to Safe font
							_FONT_ALBERTUSMT = new FontFamily("Times New Roman");
						}
					}
				}
				return _FONT_ALBERTUSMT;
			}
		}

		private static FontFamily _FONT_ALBERTUSMTLIGHT = null;
		internal static FontFamily FONT_ALBERTUSMTLIGHT
		{
			get
			{
				if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
				{
					// Code here won't run in Visual Studio designer
					if (FontLoader != null && _FONT_ALBERTUSMTLIGHT is null) _FONT_ALBERTUSMTLIGHT = FontLoader.AddFontToOS(Resources.AlbertusMTLight);// Runtime
				}
				else
				{
					// Design time
					if (_FONT_ALBERTUSMTLIGHT is null)
					{
						try
						{
							_FONT_ALBERTUSMTLIGHT = new FontFamily("Albertus MT Light");
						}
						catch
						{ // fallback to Safe font
							_FONT_ALBERTUSMTLIGHT = new FontFamily("Times New Roman");
						}
					}
				}

				return _FONT_ALBERTUSMTLIGHT;
			}
{'fraction_non_alphanumeric': 0.07811921510551648, 'fraction_numerical': 0.0, 'mean_word_length': 3.215288611544462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2965768', 'n_tokens_mistral': 1139, 'n_tokens_neox': 887, 'n_words': 213}