diff --git a/Document-Processing/PowerPoint/Conversions/PowerPoint-To-Image/NET/Fallback-Fonts-in-PPTXtoImage-Conversion.md b/Document-Processing/PowerPoint/Conversions/PowerPoint-To-Image/NET/Fallback-Fonts-in-PPTXtoImage-Conversion.md index 888e6e13d..5c35a0921 100644 --- a/Document-Processing/PowerPoint/Conversions/PowerPoint-To-Image/NET/Fallback-Fonts-in-PPTXtoImage-Conversion.md +++ b/Document-Processing/PowerPoint/Conversions/PowerPoint-To-Image/NET/Fallback-Fonts-in-PPTXtoImage-Conversion.md @@ -103,6 +103,45 @@ using (FileStream fileStreamInput = new FileStream("Template.pptx", FileMode.Ope You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PowerPoint-Examples/tree/master/PPTX-to-Image-conversion/Fallback-fonts-based-on-scripttype). +## Fallback Symbols based on script type + +The following code example demonstrates how a user can add fallback fonts for Symbols and Emojis, which Presentation considers internally when converting a PowerPoint presentation to an Image. + +{% tabs %} + +{% highlight C# tabtitle="C# [Cross-platform]" %} +//Load the PowerPoint presentation into stream. +using (FileStream fileStreamInput = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read)) +{ + //Open the existing PowerPoint presentation with loaded stream. + using (IPresentation pptxDoc = Presentation.Open(fileStreamInput)) + { + //Adds fallback font for basic symbols like bullet characters. + pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings"); + //Adds fallback font for mathematics symbols. + pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS"); + //Adds fallback font for emojis. + pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS"); + //Initialize the PresentationRenderer to perform image conversion. + pptxDoc.PresentationRenderer = new PresentationRenderer(); + //Convert PowerPoint slide to image as stream. + using (Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg)) + { + //Reset the stream position. + stream.Position = 0; + //Create the output image file stream. + using (FileStream fileStreamOutput = File.Create("Output.jpg")) + { + //Copy the converted image stream into created output stream. + stream.CopyTo(fileStreamOutput); + } + } + } +} +{% endhighlight %} + +{% endtabs %} + ## Fallback fonts for range of Unicode text Users can set fallback fonts for specific Unicode range of text to be used in Presentation to Image conversion. @@ -307,6 +346,215 @@ Korean Malgun Gothic, Batang + + Tamil + 0x0B80 - 0x0BFF + Latha, Nirmala UI, Arial Unicode MS + + + Bengali + 0x0980 - 0x09FF + Vrinda, Arial Unicode MS, Nikosh, Siyam Rupali, Nirmala UI + + + Gujarati + 0x0A80 - 0x0AFF + Shruti, Nirmala UI, Arial Unicode MS + + + Telugu + 0x0C00 - 0x0C7F + Gautami, Nirmala UI, Arial Unicode MS + + + Malayalam + 0x0D00 - 0x0D7F + Kartika, Nirmala UI, Arial Unicode MS + + + Kannada + 0x0C80 - 0x0CFF + Tunga, Nirmala UI, Arial Unicode MS + + + Ethiopic + 0x1200 - 0x137F
+ 0x1380 - 0x139F + Nyala, Ebrima + + + Khmer + 0x1780 - 0x17FF
+ 0x19E0 - 0x19FF + MoolBoran, DaunPenh, Leelawadee, Leelawadee UI + + + Gurmukhi + 0x0A00 - 0x0A7F + Raavi, Nirmala UI, Arial Unicode MS + + + Canadian + 0x1400 - 0x167F + Euphemia, Gadugi + + + Cherokee + 0x13A0 - 0x13FF
+ 0xAB70 - 0xABBF + Plantagenet Cherokee, Gadugi, Arial Unicode MS + + + Yi + 0xA000 - 0xA48F
+ 0xA490 - 0xA4CF + Microsoft Yi Baiti, Arial Unicode MS + + + Tibetan + 0x0F00 - 0x0FFF + Microsoft Himalaya, Nirmala UI, Arial Unicode MS + + + Thaana + 0x0780 - 0x07BF + MV Boli, Nirmala UI, Arial Unicode MS + + + Syriac + 0x0700 - 0x074F + Estrangelo Edessa, Segoe UI Historic, Arial Unicode MS + + + Odia + 0x0B00 - 0x0B7F + Kalinga, Nirmala UI, Arial Unicode MS + + + Lao + 0x0E80 - 0x0EFF + DokChampa, Lao UI, Leelawadee UI, Arial Unicode MS + + + Sinhala + 0x0D80 - 0x0DFF + Iskoola Pota, Nirmala UI, Arial Unicode MS + + + Mongolian + 0x1800 - 0x18AF + Mongolian Baiti, Microsoft YaHei, Arial Unicode MS + + + Vietnamese + 0x00C0 - 0x00FF
+ 0x0102 - 0x0103
+ 0x0110 - 0x0111
+ 0x0128 - 0x0129
+ 0x0168 - 0x0169
+ 0x01A0 - 0x01A1
+ 0x01AF - 0x01B0
+ 0x0300 - 0x036F + Times New Roman, Arial, Tahoma, Arial Unicode MS + + + Georgian + 0x10A0 - 0x10FF
+ 0x2D00 - 0x2D2F + Sylfaen, Arial Unicode MS + + + Armenian + 0x0530 - 0x058F
+ 0xFB13 - 0xFB17 + Arial, Sylfaen, Arial Unicode MS + + + Buginese + 0x1A00 - 0x1A1F + Leelawadee UI, Segoe UI Symbol + + + Bopomofo + 0x3100 - 0x312F
+ 0x31A0 - 0x31BF + Microsoft JhengHei, PMingLiU, SimSun, Arial Unicode MS + + + Javanese + 0xA980 - 0xA9DF + Javanese Text, Segoe UI Symbol + + + Lisu + 0xA4D0 - 0xA4FF + Segoe UI Symbol, Arial Unicode MS + + + Burmese + 0x1000 - 0x109F
+ 0xAA60 - 0xAA7F + Myanmar Text, Noto Sans Myanmar, Padauk + + + NKo + 0x07C0 - 0x07FF + Ebrima, Arial Unicode MS + + + OlChiki + 0x1C50 - 0x1C7F + Nirmala UI, Arial Unicode MS + + + Osmanya + 0x10480 - 0x104AF + Ebrima, Noto Sans Osmanya + + + PhagsPa + 0xA840 - 0xA87F + Phagspa, Microsoft PhagsPa, Noto Sans PhagsPa, Arial Unicode MS + + + SoraSompeng + 0x110D0 - 0x110FF + Nirmala UI, Arial Unicode MS + + + TaiLe + 0x1950 - 0x197F + Microsoft Tai Le, Arial Unicode MS + + + NewTaiLue + 0x1980 - 0x19DF + Microsoft New Tai Lue, Arial Unicode MS + + + Tifinagh + 0x2D30 - 0x2D7F + Ebrima, Arial Unicode MS + + + Symbols + 0x2000 - 0x27BF
+ 0x2300 - 0x23FF
+ 0xF000 - 0xF104 + Segoe UI Symbol, Arial Unicode MS, Wingdings + + + Mathematics + 0x2200 - 0x2AFF
+ 0x1D400 - 0x1D7FF + Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS + + + Emoji + 0x1F300 - 0x1FAFF
+ 0xFE0F - 0xFE0F + Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS + N> The .NET PowerPoint Library (Presentation) uses System.Drawing functionalities for PowerPoint to image conversion conversion in .NET Framework applications. And System.Drawing itself uses a fallback font to preserve the Unicode text while drawing the text in the image. So, these Fallback fonts APIs are **not supported in .NET Framework**. diff --git a/Document-Processing/PowerPoint/Conversions/PowerPoint-To-PDF/NET/Fallback-Fonts-in-PPTXtoPDF-Conversion.md b/Document-Processing/PowerPoint/Conversions/PowerPoint-To-PDF/NET/Fallback-Fonts-in-PPTXtoPDF-Conversion.md index ad697da46..5471b1d75 100644 --- a/Document-Processing/PowerPoint/Conversions/PowerPoint-To-PDF/NET/Fallback-Fonts-in-PPTXtoPDF-Conversion.md +++ b/Document-Processing/PowerPoint/Conversions/PowerPoint-To-PDF/NET/Fallback-Fonts-in-PPTXtoPDF-Conversion.md @@ -210,6 +210,94 @@ pptxDoc.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PowerPoint-Examples/tree/master/PPTX-to-PDF-conversion/Fallback-fonts-based-on-scripttype). +## Fallback Symbols based on script type + +The following code example demonstrates how a user can add fallback fonts for Symbols and Emojis, which Presentation considers internally when converting a PowerPoint presentation to PDF. + +{% tabs %} + +{% highlight C# tabtitle="C# [Cross-platform]" %} +//Load the PowerPoint presentation into stream. +using (FileStream fileStreamInput = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read)) +{ + //Open the existing PowerPoint presentation with loaded stream. + using (IPresentation pptxDoc = Presentation.Open(fileStreamInput)) + { + //Adds fallback font for basic symbols like bullet characters. + pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings"); + //Adds fallback font for mathematics symbols. + pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS"); + //Adds fallback font for emojis. + pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS"); + //Create the MemoryStream to save the converted PDF. + using (MemoryStream pdfStream = new MemoryStream()) + { + //Convert the PowerPoint document to PDF document. + using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc)) + { + //Save the converted PDF document to MemoryStream. + pdfDocument.Save(pdfStream); + pdfStream.Position = 0; + } + //Create the output PDF file stream. + using (FileStream fileStreamOutput = File.Create("Output.pdf")) + { + //Copy the converted PDF stream into created output PDF stream. + pdfStream.CopyTo(fileStreamOutput); + } + } + } +} +{% endhighlight %} + +{% highlight C# tabtitle="C# [Windows-specific]" %} +//Opens a PowerPoint Presentation. +IPresentation pptxDoc = Presentation.Open("Sample.pptx"); +//Initialize the conversion settings. +PresentationToPdfConverterSettings pdfConverterSettings = new PresentationToPdfConverterSettings(); +//Enable the portable rendering. +pdfConverterSettings.EnablePortableRendering = true; +//Adds fallback font for basic symbols like bullet characters. +pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings"); +//Adds fallback font for mathematics symbols. +pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS"); +//Adds fallback font for emojis. +pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS"); +//Converts the PowerPoint Presentation into PDF document with Portable rendering option. +PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc); +//Saves the PDF document. +pdfDocument.Save("Sample.pdf"); +//Closes the PDF document. +pdfDocument.Close(true); +//Closes the Presentation. +pptxDoc.Close(); +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Opens a PowerPoint Presentation. +Dim pptxDoc As IPresentation = Presentation.Open("Sample.pptx") +'Initialize the conversion settings. +Dim pdfConverterSettings As PresentationToPdfConverterSettings = new PresentationToPdfConverterSettings() +'Enable the portable rendering. +pdfConverterSettings.EnablePortableRendering = true +'Adds fallback font for basic symbols Like bullet characters. +pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings") +'Adds fallback font for mathematics symbols. +pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS") +'Adds fallback font for emojis. +pptxDoc.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS") +'Converts the PowerPoint Presentation into PDF document. +Dim pdfDocument As PdfDocument = PresentationToPdfConverter.Convert(pptxDoc) +'Saves the PDF document. +pdfDocument.Save("Sample.pdf") +'Closes the PDF document. +pdfDocument.Close(True) +'Closes the Presentation. +pptxDoc.Close() +{% endhighlight %} + +{% endtabs %} + ## Fallback fonts for range of Unicode text Users can set fallback fonts for specific Unicode range of text to be used in presentation to PDF conversion. @@ -533,4 +621,213 @@ Korean Malgun Gothic, Batang + + Tamil + 0x0B80 - 0x0BFF + Latha, Nirmala UI, Arial Unicode MS + + + Bengali + 0x0980 - 0x09FF + Vrinda, Arial Unicode MS, Nikosh, Siyam Rupali, Nirmala UI + + + Gujarati + 0x0A80 - 0x0AFF + Shruti, Nirmala UI, Arial Unicode MS + + + Telugu + 0x0C00 - 0x0C7F + Gautami, Nirmala UI, Arial Unicode MS + + + Malayalam + 0x0D00 - 0x0D7F + Kartika, Nirmala UI, Arial Unicode MS + + + Kannada + 0x0C80 - 0x0CFF + Tunga, Nirmala UI, Arial Unicode MS + + + Ethiopic + 0x1200 - 0x137F
+ 0x1380 - 0x139F + Nyala, Ebrima + + + Khmer + 0x1780 - 0x17FF
+ 0x19E0 - 0x19FF + MoolBoran, DaunPenh, Leelawadee, Leelawadee UI + + + Gurmukhi + 0x0A00 - 0x0A7F + Raavi, Nirmala UI, Arial Unicode MS + + + Canadian + 0x1400 - 0x167F + Euphemia, Gadugi + + + Cherokee + 0x13A0 - 0x13FF
+ 0xAB70 - 0xABBF + Plantagenet Cherokee, Gadugi, Arial Unicode MS + + + Yi + 0xA000 - 0xA48F
+ 0xA490 - 0xA4CF + Microsoft Yi Baiti, Arial Unicode MS + + + Tibetan + 0x0F00 - 0x0FFF + Microsoft Himalaya, Nirmala UI, Arial Unicode MS + + + Thaana + 0x0780 - 0x07BF + MV Boli, Nirmala UI, Arial Unicode MS + + + Syriac + 0x0700 - 0x074F + Estrangelo Edessa, Segoe UI Historic, Arial Unicode MS + + + Odia + 0x0B00 - 0x0B7F + Kalinga, Nirmala UI, Arial Unicode MS + + + Lao + 0x0E80 - 0x0EFF + DokChampa, Lao UI, Leelawadee UI, Arial Unicode MS + + + Sinhala + 0x0D80 - 0x0DFF + Iskoola Pota, Nirmala UI, Arial Unicode MS + + + Mongolian + 0x1800 - 0x18AF + Mongolian Baiti, Microsoft YaHei, Arial Unicode MS + + + Vietnamese + 0x00C0 - 0x00FF
+ 0x0102 - 0x0103
+ 0x0110 - 0x0111
+ 0x0128 - 0x0129
+ 0x0168 - 0x0169
+ 0x01A0 - 0x01A1
+ 0x01AF - 0x01B0
+ 0x0300 - 0x036F + Times New Roman, Arial, Tahoma, Arial Unicode MS + + + Georgian + 0x10A0 - 0x10FF
+ 0x2D00 - 0x2D2F + Sylfaen, Arial Unicode MS + + + Armenian + 0x0530 - 0x058F
+ 0xFB13 - 0xFB17 + Arial, Sylfaen, Arial Unicode MS + + + Buginese + 0x1A00 - 0x1A1F + Leelawadee UI, Segoe UI Symbol + + + Bopomofo + 0x3100 - 0x312F
+ 0x31A0 - 0x31BF + Microsoft JhengHei, PMingLiU, SimSun, Arial Unicode MS + + + Javanese + 0xA980 - 0xA9DF + Javanese Text, Segoe UI Symbol + + + Lisu + 0xA4D0 - 0xA4FF + Segoe UI Symbol, Arial Unicode MS + + + Burmese + 0x1000 - 0x109F
+ 0xAA60 - 0xAA7F + Myanmar Text, Noto Sans Myanmar, Padauk + + + NKo + 0x07C0 - 0x07FF + Ebrima, Arial Unicode MS + + + OlChiki + 0x1C50 - 0x1C7F + Nirmala UI, Arial Unicode MS + + + Osmanya + 0x10480 - 0x104AF + Ebrima, Noto Sans Osmanya + + + PhagsPa + 0xA840 - 0xA87F + Phagspa, Microsoft PhagsPa, Noto Sans PhagsPa, Arial Unicode MS + + + SoraSompeng + 0x110D0 - 0x110FF + Nirmala UI, Arial Unicode MS + + + TaiLe + 0x1950 - 0x197F + Microsoft Tai Le, Arial Unicode MS + + + NewTaiLue + 0x1980 - 0x19DF + Microsoft New Tai Lue, Arial Unicode MS + + + Tifinagh + 0x2D30 - 0x2D7F + Ebrima, Arial Unicode MS + + + Symbols + 0x2000 - 0x27BF
+ 0x2300 - 0x23FF
+ 0xF000 - 0xF104 + Segoe UI Symbol, Arial Unicode MS, Wingdings + + + Mathematics + 0x2200 - 0x2AFF
+ 0x1D400 - 0x1D7FF + Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS + + + Emoji + 0x1F300 - 0x1FAFF
+ 0xFE0F - 0xFE0F + Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS + \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md index 28cafa556..661e80486 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md @@ -111,6 +111,49 @@ using (FileStream inputStream = new FileStream("Template.docx", FileMode.Open, F You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-Image-conversion/Fallback-fonts-based-on-scripttype). +## Fallback Symbols based on script type + +The following code example demonstrates how a user can add fallback fonts for Symbols and Emojis, which DocIO considers internally when converting a Word document to image. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +//Opens the file as stream. +using (FileStream inputStream = new FileStream("Template.docx", FileMode.Open, FileAccess.Read)) +{ + //Loads an existing Word document file stream. + using (WordDocument wordDocument = new WordDocument(inputStream, Syncfusion.DocIO.FormatType.Docx)) + { + //Adds fallback font for basic symbols like bullet characters. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings"); + //Adds fallback font for mathematics symbols. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS"); + //Adds fallback font for emojis. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS"); + //Instantiation of DocIORenderer for Word to image conversion. + using (DocIORenderer render = new DocIORenderer()) + { + //Convert the entire Word document to images. + Stream[] imageStreams = wordDocument.RenderAsImages(); + int i = 0; + foreach (Stream stream in imageStreams) + { + //Reset the stream position. + stream.Position = 0; + //Save the stream as file. + using (FileStream fileStreamOutput = File.Create("WordToImage_" + i + ".jpeg")) + { + stream.CopyTo(fileStreamOutput); + } + i++; + } + } + } +} +{% endhighlight %} + +{% endtabs %} + ## Fallback fonts for range of Unicode text Users can set fallback fonts for specific Unicode range of text to be used in Word to Image conversion. @@ -325,6 +368,215 @@ Korean Malgun Gothic, Batang + + Tamil + 0x0B80 - 0x0BFF + Latha, Nirmala UI, Arial Unicode MS + + + Bengali + 0x0980 - 0x09FF + Vrinda, Arial Unicode MS, Nikosh, Siyam Rupali, Nirmala UI + + + Gujarati + 0x0A80 - 0x0AFF + Shruti, Nirmala UI, Arial Unicode MS + + + Telugu + 0x0C00 - 0x0C7F + Gautami, Nirmala UI, Arial Unicode MS + + + Malayalam + 0x0D00 - 0x0D7F + Kartika, Nirmala UI, Arial Unicode MS + + + Kannada + 0x0C80 - 0x0CFF + Tunga, Nirmala UI, Arial Unicode MS + + + Ethiopic + 0x1200 - 0x137F
+ 0x1380 - 0x139F + Nyala, Ebrima + + + Khmer + 0x1780 - 0x17FF
+ 0x19E0 - 0x19FF + MoolBoran, DaunPenh, Leelawadee, Leelawadee UI + + + Gurmukhi + 0x0A00 - 0x0A7F + Raavi, Nirmala UI, Arial Unicode MS + + + Canadian + 0x1400 - 0x167F + Euphemia, Gadugi + + + Cherokee + 0x13A0 - 0x13FF
+ 0xAB70 - 0xABBF + Plantagenet Cherokee, Gadugi, Arial Unicode MS + + + Yi + 0xA000 - 0xA48F
+ 0xA490 - 0xA4CF + Microsoft Yi Baiti, Arial Unicode MS + + + Tibetan + 0x0F00 - 0x0FFF + Microsoft Himalaya, Nirmala UI, Arial Unicode MS + + + Thaana + 0x0780 - 0x07BF + MV Boli, Nirmala UI, Arial Unicode MS + + + Syriac + 0x0700 - 0x074F + Estrangelo Edessa, Segoe UI Historic, Arial Unicode MS + + + Odia + 0x0B00 - 0x0B7F + Kalinga, Nirmala UI, Arial Unicode MS + + + Lao + 0x0E80 - 0x0EFF + DokChampa, Lao UI, Leelawadee UI, Arial Unicode MS + + + Sinhala + 0x0D80 - 0x0DFF + Iskoola Pota, Nirmala UI, Arial Unicode MS + + + Mongolian + 0x1800 - 0x18AF + Mongolian Baiti, Microsoft YaHei, Arial Unicode MS + + + Vietnamese + 0x00C0 - 0x00FF
+ 0x0102 - 0x0103
+ 0x0110 - 0x0111
+ 0x0128 - 0x0129
+ 0x0168 - 0x0169
+ 0x01A0 - 0x01A1
+ 0x01AF - 0x01B0
+ 0x0300 - 0x036F + Times New Roman, Arial, Tahoma, Arial Unicode MS + + + Georgian + 0x10A0 - 0x10FF
+ 0x2D00 - 0x2D2F + Sylfaen, Arial Unicode MS + + + Armenian + 0x0530 - 0x058F
+ 0xFB13 - 0xFB17 + Arial, Sylfaen, Arial Unicode MS + + + Buginese + 0x1A00 - 0x1A1F + Leelawadee UI, Segoe UI Symbol + + + Bopomofo + 0x3100 - 0x312F
+ 0x31A0 - 0x31BF + Microsoft JhengHei, PMingLiU, SimSun, Arial Unicode MS + + + Javanese + 0xA980 - 0xA9DF + Javanese Text, Segoe UI Symbol + + + Lisu + 0xA4D0 - 0xA4FF + Segoe UI Symbol, Arial Unicode MS + + + Burmese + 0x1000 - 0x109F
+ 0xAA60 - 0xAA7F + Myanmar Text, Noto Sans Myanmar, Padauk + + + NKo + 0x07C0 - 0x07FF + Ebrima, Arial Unicode MS + + + OlChiki + 0x1C50 - 0x1C7F + Nirmala UI, Arial Unicode MS + + + Osmanya + 0x10480 - 0x104AF + Ebrima, Noto Sans Osmanya + + + PhagsPa + 0xA840 - 0xA87F + Phagspa, Microsoft PhagsPa, Noto Sans PhagsPa, Arial Unicode MS + + + SoraSompeng + 0x110D0 - 0x110FF + Nirmala UI, Arial Unicode MS + + + TaiLe + 0x1950 - 0x197F + Microsoft Tai Le, Arial Unicode MS + + + NewTaiLue + 0x1980 - 0x19DF + Microsoft New Tai Lue, Arial Unicode MS + + + Tifinagh + 0x2D30 - 0x2D7F + Ebrima, Arial Unicode MS + + + Symbols + 0x2000 - 0x27BF
+ 0x2300 - 0x23FF
+ 0xF000 - 0xF104 + Segoe UI Symbol, Arial Unicode MS, Wingdings + + + Mathematics + 0x2200 - 0x2AFF
+ 0x1D400 - 0x1D7FF + Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS + + + Emoji + 0x1F300 - 0x1FAFF
+ 0xFE0F - 0xFE0F + Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS + N> 1. In Azure Web Service and Azure APP Service, .NET GDI+ (System.Drawing) does not support the Metafile image (vector image). So, the image will be generated as Bitmap (raster image). diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md index 4a105d048..958a7009e 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md @@ -195,6 +195,89 @@ End Using You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Fallback-fonts-based-on-scripttype). +## Fallback Symbols based on script type + +The following code example demonstrates how a user can add fallback fonts for Symbols and Emojis, which DocIO considers internally when converting a Word document to PDF. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +//Opens the file as stream. +using (FileStream inputStream = new FileStream("Template.docx", FileMode.Open, FileAccess.Read)) +{ + //Loads an existing Word document file stream. + using (WordDocument wordDocument = new WordDocument(inputStream, Syncfusion.DocIO.FormatType.Docx)) + { + //Adds fallback font for basic symbols like bullet characters. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings"); + //Adds fallback font for mathematics symbols. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS"); + //Adds fallback font for emojis. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS"); + //Instantiation of DocIORenderer for Word to PDF conversion. + using (DocIORenderer render = new DocIORenderer()) + { + //Converts Word document into PDF document. + using (PdfDocument pdfDocument = render.ConvertToPDF(wordDocument)) + { + //Saves the PDF file to file system. + using (FileStream outputStream = new FileStream("WordToPDF.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite)) + { + pdfDocument.Save(outputStream); + } + } + } + } +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +//Loads an existing Word document. +using (WordDocument wordDocument = new WordDocument("Template.docx", Syncfusion.DocIO.FormatType.Docx)) +{ + //Adds fallback font for basic symbols like bullet characters. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings"); + //Adds fallback font for mathematics symbols. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS"); + //Adds fallback font for emojis. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS"); + //Instantiation of DocToPDFConverter for Word to PDF conversion. + using (DocToPDFConverter converter = new DocToPDFConverter()) + { + //Converts Word document into PDF document. + using (PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument)) + { + //Saves the PDF file to file system. + pdfDocument.Save("WordToPDF.pdf"); + } + } +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Loads an existing Word document. +Using wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx) + 'Adds fallback font for basic symbols Like bullet characters. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings") + 'Adds fallback font for mathematics symbols. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS") + 'Adds fallback font for emojis. + wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Emoji, "Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS") + 'Instantiation of DocToPDFConverter for Word to PDF conversion. + Using converter As New DocToPDFConverter() + 'Converts Word document into PDF document. + Using pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument) + 'Saves the PDF file to file system. + pdfDocument.Save("WordToPDF.pdf") + End Using + End Using +End Using +{% endhighlight %} + +{% endtabs %} + + + ## Fallback fonts for range of Unicode text Users can set fallback fonts for specific Unicode range of text to be used in Word to PDF conversion. @@ -513,4 +596,213 @@ Korean Malgun Gothic, Batang + + Tamil + 0x0B80 - 0x0BFF + Latha, Nirmala UI, Arial Unicode MS + + + Bengali + 0x0980 - 0x09FF + Vrinda, Arial Unicode MS, Nikosh, Siyam Rupali, Nirmala UI + + + Gujarati + 0x0A80 - 0x0AFF + Shruti, Nirmala UI, Arial Unicode MS + + + Telugu + 0x0C00 - 0x0C7F + Gautami, Nirmala UI, Arial Unicode MS + + + Malayalam + 0x0D00 - 0x0D7F + Kartika, Nirmala UI, Arial Unicode MS + + + Kannada + 0x0C80 - 0x0CFF + Tunga, Nirmala UI, Arial Unicode MS + + + Ethiopic + 0x1200 - 0x137F
+ 0x1380 - 0x139F + Nyala, Ebrima + + + Khmer + 0x1780 - 0x17FF
+ 0x19E0 - 0x19FF + MoolBoran, DaunPenh, Leelawadee, Leelawadee UI + + + Gurmukhi + 0x0A00 - 0x0A7F + Raavi, Nirmala UI, Arial Unicode MS + + + Canadian + 0x1400 - 0x167F + Euphemia, Gadugi + + + Cherokee + 0x13A0 - 0x13FF
+ 0xAB70 - 0xABBF + Plantagenet Cherokee, Gadugi, Arial Unicode MS + + + Yi + 0xA000 - 0xA48F
+ 0xA490 - 0xA4CF + Microsoft Yi Baiti, Arial Unicode MS + + + Tibetan + 0x0F00 - 0x0FFF + Microsoft Himalaya, Nirmala UI, Arial Unicode MS + + + Thaana + 0x0780 - 0x07BF + MV Boli, Nirmala UI, Arial Unicode MS + + + Syriac + 0x0700 - 0x074F + Estrangelo Edessa, Segoe UI Historic, Arial Unicode MS + + + Odia + 0x0B00 - 0x0B7F + Kalinga, Nirmala UI, Arial Unicode MS + + + Lao + 0x0E80 - 0x0EFF + DokChampa, Lao UI, Leelawadee UI, Arial Unicode MS + + + Sinhala + 0x0D80 - 0x0DFF + Iskoola Pota, Nirmala UI, Arial Unicode MS + + + Mongolian + 0x1800 - 0x18AF + Mongolian Baiti, Microsoft YaHei, Arial Unicode MS + + + Vietnamese + 0x00C0 - 0x00FF
+ 0x0102 - 0x0103
+ 0x0110 - 0x0111
+ 0x0128 - 0x0129
+ 0x0168 - 0x0169
+ 0x01A0 - 0x01A1
+ 0x01AF - 0x01B0
+ 0x0300 - 0x036F + Times New Roman, Arial, Tahoma, Arial Unicode MS + + + Georgian + 0x10A0 - 0x10FF
+ 0x2D00 - 0x2D2F + Sylfaen, Arial Unicode MS + + + Armenian + 0x0530 - 0x058F
+ 0xFB13 - 0xFB17 + Arial, Sylfaen, Arial Unicode MS + + + Buginese + 0x1A00 - 0x1A1F + Leelawadee UI, Segoe UI Symbol + + + Bopomofo + 0x3100 - 0x312F
+ 0x31A0 - 0x31BF + Microsoft JhengHei, PMingLiU, SimSun, Arial Unicode MS + + + Javanese + 0xA980 - 0xA9DF + Javanese Text, Segoe UI Symbol + + + Lisu + 0xA4D0 - 0xA4FF + Segoe UI Symbol, Arial Unicode MS + + + Burmese + 0x1000 - 0x109F
+ 0xAA60 - 0xAA7F + Myanmar Text, Noto Sans Myanmar, Padauk + + + NKo + 0x07C0 - 0x07FF + Ebrima, Arial Unicode MS + + + OlChiki + 0x1C50 - 0x1C7F + Nirmala UI, Arial Unicode MS + + + Osmanya + 0x10480 - 0x104AF + Ebrima, Noto Sans Osmanya + + + PhagsPa + 0xA840 - 0xA87F + Phagspa, Microsoft PhagsPa, Noto Sans PhagsPa, Arial Unicode MS + + + SoraSompeng + 0x110D0 - 0x110FF + Nirmala UI, Arial Unicode MS + + + TaiLe + 0x1950 - 0x197F + Microsoft Tai Le, Arial Unicode MS + + + NewTaiLue + 0x1980 - 0x19DF + Microsoft New Tai Lue, Arial Unicode MS + + + Tifinagh + 0x2D30 - 0x2D7F + Ebrima, Arial Unicode MS + + + Symbols + 0x2000 - 0x27BF
+ 0x2300 - 0x23FF
+ 0xF000 - 0xF104 + Segoe UI Symbol, Arial Unicode MS, Wingdings + + + Mathematics + 0x2200 - 0x2AFF
+ 0x1D400 - 0x1D7FF + Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS + + + Emoji + 0x1F300 - 0x1FAFF
+ 0xFE0F - 0xFE0F + Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS +