Esempio n. 1
0
        /// <summary>
        /// Gets a collection of all scripts supported by the typeface. List of all known script tags can be found here: http://www.microsoft.com/typography/developers/opentype/scripttags.aspx .
        /// </summary>
        /// <param name="typeface">The typeface.</param>
        /// <returns>Collection of tags.</returns>
        public IEnumerable <Tag> GetScriptTags(GlyphTypeface typeface)
        {
            dynamic fontTableHeader = this.GetFontTableHeader();
            dynamic fontTable       = this.GetFontTable(typeface);

            if (!fontTable.IsPresent)
            {
                return(Enumerable.Empty <Tag>());
            }

            dynamic scriptList = new AccessPrivateWrapper(fontTableHeader.GetScriptList(fontTable.Wrapped));

            var uintTags = this.GetEnumerableFromInternalList(
                () => scriptList.GetScriptCount(fontTable.Wrapped),
                p => (uint)scriptList.GetScriptTag(fontTable.Wrapped, p));

            return(uintTags.Select(TagConverter.TagFromUint));
        }