'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.TextImports GCTEXT = GrapeCity.Documents.Text '' Ligatures (joining two or more letters into a single glyph) are supported by DsPdf,'' provided the selected font supports them, and the corresponding font feature is on.'' For the complete list of font features see featurelist.htm.'' See also FontFeatures.PublicClassLigaturesFunctionCreatePDF(ByVal stream AsStream) AsInteger'' The list of common Latin ligatures:ConstlatinLigatures = "fi, fj, fl, ff, ffi, ffl."'' Set up ligature-related font features:'' All ON:Dim allOn AsFontFeature() = {NewFontFeature(FeatureTag.clig, True), '' Contextual LigaturesNewFontFeature(FeatureTag.dlig, True), '' Discretionary LigaturesNewFontFeature(FeatureTag.hlig, True), '' Historical LigaturesNewFontFeature(FeatureTag.liga, True), '' Standard LigaturesNewFontFeature(FeatureTag.rlig, True) '' Required Ligatures }'' All OFF:Dim allOff AsFontFeature() = {NewFontFeature(FeatureTag.clig, False),NewFontFeature(FeatureTag.dlig, False),NewFontFeature(FeatureTag.hlig, False),NewFontFeature(FeatureTag.liga, False),NewFontFeature(FeatureTag.rlig, False) }Dim doc = NewGcPdfDocument()Dim g = doc.NewPage().Graphics'' Text insertion point:Dim ip = NewPointF(72, 72)Dim tf = NewTextFormat() tf.Font = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "NotoSerif-Regular.ttf")) tf.FontSize = 20 g.DrawString($"Common Latin ligatures, font {tf.Font.FontFamilyName}", tf, ip) ip.Y += 36'' Turn all ligature features OFF: tf.FontFeatures = allOff g.DrawString($"All ligature features OFF: {latinLigatures}", tf, ip) ip.Y += 36'' Turn all ligature features ON: tf.FontFeatures = allOn g.DrawString($"All ligature features ON: {latinLigatures}", tf, ip) ip.Y += 72'' Repeat with a different font: tf.Font = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "FoglihtenNo07.otf")) g.DrawString($"Common Latin ligatures, font {tf.Font.FontFamilyName}", tf, ip) ip.Y += 36'' Turn all ligature features OFF: tf.FontFeatures = allOff g.DrawString($"All ligature features OFF: {latinLigatures}", tf, ip) ip.Y += 36'' Turn all ligature features ON: tf.FontFeatures = allOn g.DrawString($"All ligature features ON: {latinLigatures}", tf, ip)'''' Done: doc.Save(stream)Return doc.Pages.CountEndFunctionEndClass