Example #1
0
        public void Normalize()
        {
            if (_tokenCount != -1)
            {
                return;
            }
            var tokens = FriendlyName.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            var count  = tokens.Length;
            var array  = new NormalizedFontFamilyReference[count];

            for (int i = 0; i < count; i++)
            {
                array[i] = NormalizedFontFamilyReference.Create(BaseUri, NormalizeFontFamilyReference(tokens[i]));
            }
            _tokenCount    = count;
            _nffReferences = array;
        }
Example #2
0
        private static IFontFamily LookupFontFamily(NormalizedFontFamilyReference familyReference)
        {
            if (familyReference.IsUnresolved)
            {
                return(null);
            }

            FamilyCollection familyCollection;

            if (familyReference.LocationUri != null)
            {
                familyCollection = FamilyCollection.FromUri(familyReference.LocationUri);
            }
            else
            {
                familyCollection = FamilyCollection.Default;
            }
            return(familyCollection.LookupFamily(familyReference.FamilyName));
        }