Ejemplo n.º 1
0
        internal PreviewFontInfo ReadPreviewFontInfo(TableEntryCollection tables, BinaryReader input)
        {
            var rd = new EntriesReaderHelper(tables, input);

            NameEntry nameEntry = rd.Read(new NameEntry());
            OS2Table  os2Table  = rd.Read(new OS2Table());
            //for preview, read ONLY  script list from gsub and gpos (set OnlyScriptList).
            Meta metaTable = rd.Read(new Meta());

            GSUB gsub = rd.Read(new GSUB()
            {
                OnlyScriptList = true
            });
            GPOS gpos = rd.Read(new GPOS()
            {
                OnlyScriptList = true
            });
            Cmap cmap = rd.Read(new Cmap());
            //gsub and gpos contains actual script_list that are in the typeface

            Languages langs = new Languages();

            langs.Update(os2Table, metaTable, cmap, gsub, gpos);

            return(new PreviewFontInfo(
                       nameEntry,
                       os2Table,
                       langs));
        }
Ejemplo n.º 2
0
        internal PreviewFontInfo ReadPreviewFontInfo(TableEntryCollection tables, BinaryReader input)
        {
            var rd = new EntriesReaderHelper(tables, input);

            NameEntry nameEntry = rd.Read(new NameEntry());
            OS2Table  os2Table  = rd.Read(new OS2Table());
            //for preview, read ONLY  script list from gsub and gpos (set OnlyScriptList).
            Meta metaTable = rd.Read(new Meta());

            GSUB gsub = rd.Read(new GSUB()
            {
                OnlyScriptList = true
            });
            GPOS gpos = rd.Read(new GPOS()
            {
                OnlyScriptList = true
            });
            //gsub and gpos contains actual script_list that are in the typeface

            Languages langs = new Languages();

            langs.Update(os2Table, metaTable, gsub, gpos);

            return(new PreviewFontInfo(
                       nameEntry.FontName,
                       nameEntry.FontSubFamily,
                       nameEntry.TypographicFamilyName,
                       nameEntry.TypographyicSubfamilyName,
                       os2Table.usWeightClass,
                       langs,
                       Extensions.TypefaceExtensions.TranslatedOS2FontStyle(os2Table))
            {
                PostScriptName = nameEntry.PostScriptName,
                UniqueFontIden = nameEntry.UniqueFontIden,
                VersionString = nameEntry.VersionString
            });
        }
Ejemplo n.º 3
0
 /// <summary>
 /// undate lang info
 /// </summary>
 /// <param name="metaTable"></param>
 internal void UpdateLangs(Meta metaTable) => Languages.Update(OS2Table, metaTable, CmapTable, this.GSUBTable, this.GPOSTable);