示例#1
0
        public static IFontCollection AddFont(this IFontCollection fontCollection, string filename, string?alias = null)
        {
            _ = filename ?? throw new ArgumentNullException(nameof(filename));
            if (string.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentException("Filename was not a valid file name.", nameof(filename));
            }

            fontCollection.Add(new FontDescriptor(filename, alias, null));
            return(fontCollection);
        }
 public static IFontCollection AddCompatibilityFonts(this IFontCollection fontCollection, params global::System.Reflection.Assembly[] assemblies)
 {
     Internals.Registrar.RegisterAll(
         assemblies,
         null,
         new[]
     {
         typeof(ExportFontAttribute)
     }, default(InitializationFlags),
         null);
     return(fontCollection);
 }
示例#3
0
 public static IFontCollection AddCompatibilityFonts(this IFontCollection fontCollection, IFontRegistrar fontRegistrar, params global::System.Reflection.Assembly[] assemblies)
 {
     Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
     Internals.Registrar.RegisterAll(
         assemblies,
         null,
         new[]
     {
         typeof(ExportFontAttribute)
     }, default(InitializationFlags),
         null,
         fontRegistrar);
     return(fontCollection);
 }
示例#4
0
        public FontManager(IIdGenerator idGenerator,
                           IStartupPropertiesCache startUpPropertiesCache,
                           IFontCollection fontCollection,
                           IFontLoader fontLoader)
        {
            _idGenerator        = idGenerator;
            _fontLoader         = fontLoader;
            _userFontCollection = fontCollection;
            _startUpProperties  = startUpPropertiesCache.User;

            LoadSystemFonts();

            _fontsForDestruction = new List <Tuple <ulong, bool> >();
        }
示例#5
0
 private static void InstallFont(IFontCollection fonts, byte[] font)
 {
     using var ms = new MemoryStream(font);
     fonts.Install(ms);
 }
 internal void AddFonts(IFontCollection fonts)
 {
     _registerFonts(fonts);
 }
示例#7
0
 public void SetFontCollection(TextRange textRange, IFontCollection fontCollection)
 {
     base.innerRefT.SetFontCollection(textRange, fontCollection);
 }
 public static IFontCollection CreateRef(this IFontCollection objectRef) =>
 ((IFontCollection)objectRef.CreateRef(typeof(IFontCollection)));
 public ITextFormat CreateTextFormat(string fontFamilyName, IFontCollection fontCollection, FontWeight fontWeight, FontStyle fontStyle, FontStretch fontStretch, float fontSize, CultureInfo locale) =>
 base.innerRefT.CreateTextFormat(fontFamilyName, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, locale);
示例#10
0
 public static IFontCollection AddFont(this IFontCollection fontCollection, string filename, string?alias = null)
 {
     fontCollection.Add(new FontDescriptor(filename, alias));
     return(fontCollection);
 }