Beispiel #1
0
        private static List <CompositeFontFamily> GetCompositeFontList(FontSourceCollection fontSourceCollection)
        {
            List <CompositeFontFamily> compositeFonts = new List <CompositeFontFamily>();

            foreach (FontSource fontSource in fontSourceCollection)
            {
                if (fontSource.IsComposite)
                {
                    CompositeFontInfo   fontInfo        = CompositeFontParser.LoadXml(fontSource.GetStream());
                    CompositeFontFamily compositeFamily = new CompositeFontFamily(fontInfo);
                    compositeFonts.Add(compositeFamily);
                }
            }

            return(compositeFonts);
        }
Beispiel #2
0
            internal static CompositeFontFamily GetCompositeFontFamilyAtIndex(int index)
            {
                if (_systemCompositeFonts[index] == null)
                {
                    lock (_systemCompositeFontsLock)
                    {
                        if (_systemCompositeFonts[index] == null)
                        {
                            FontSource fontSource = new FontSource(new Uri(Path.Combine(FamilyCollection.SxSFontsResourcePrefix, _systemCompositeFontsFileNames[index] + Util.CompositeFontExtension), UriKind.RelativeOrAbsolute),
                                                                   skipDemand: true,
                                                                   isComposite: true,
                                                                   isInternalCompositeFont: true);

                            CompositeFontInfo fontInfo = CompositeFontParser.LoadXml(fontSource.GetStream());
                            _systemCompositeFonts[index] = new CompositeFontFamily(fontInfo);
                        }
                    }
                }
                return(_systemCompositeFonts[index]);
            }
Beispiel #3
0
            internal static CompositeFontFamily GetCompositeFontFamilyAtIndex(int index)
            {
                if (_systemCompositeFonts[index] == null)
                {
                    lock (_systemCompositeFontsLock)
                    {
                        if (_systemCompositeFonts[index] == null)
                        {
                            FontSource fontSource = new FontSource(new Uri(FamilyCollection.SxSFontsLocation + _systemCompositeFontsFileNames[index] + Util.CompositeFontExtension, UriKind.Absolute),
                                                                   true, //skipDemand.
                                                                         //We skip demand here since this class should cache
                                                                         //all system composite fonts for the current process
                                                                         //Demanding read permissions should be done by FamilyCollection.cs

                                                                   true  //isComposite
                                                                   );

                            CompositeFontInfo fontInfo = CompositeFontParser.LoadXml(fontSource.GetStream());
                            _systemCompositeFonts[index] = new CompositeFontFamily(fontInfo);
                        }
                    }
                }
                return(_systemCompositeFonts[index]);
            }
Beispiel #4
0
 /// <summary>
 /// Construct a composite font family from composite font info
 /// </summary>
 internal CompositeFontFamily(CompositeFontInfo fontInfo)
 {
     _fontInfo = fontInfo;
 }
 internal FontFamilyMapCollection(CompositeFontInfo fontInfo)
 {
     _fontInfo = fontInfo;
     _items    = null;
     _count    = 0;
 }