<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Documentation – Configuring Fonts for Rendering Spreadsheets with Golang via C&#43;&#43;</title>
    <link>https://docs.aspose.com/cells/go-cpp/configuring-fonts-for-rendering-spreadsheets/</link>
    <description>Recent content in Configuring Fonts for Rendering Spreadsheets with Golang via C&#43;&#43; on Documentation</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="https://docs.aspose.com/cells/go-cpp/configuring-fonts-for-rendering-spreadsheets/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Gocpp: Supported Font Formats with Go</title>
      <link>https://docs.aspose.com/cells/gocpp/supported-font-formats/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/gocpp/supported-font-formats/</guid>
      <description>
        
        
        &lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align:left&#34;&gt;&lt;strong&gt;Format&lt;/strong&gt;&lt;/th&gt;
&lt;th style=&#34;text-align:left&#34;&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left&#34;&gt;&lt;strong&gt;TTF&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;TrueType Fonts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left&#34;&gt;&lt;strong&gt;TTC&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;TrueType Collection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left&#34;&gt;&lt;strong&gt;OTF&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;OpenType Fonts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-AddCellsToMicrosoftExcelFormulaWatchWindow.go&#34;&gt;&lt;/script&gt;


      </description>
    </item>
    
    <item>
      <title>Gocpp: Set DefaultFont property of PdfSaveOptions and ImageOrPrintOptions to have priority with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/set-defaultfont-property-of-pdfsaveoptions-and-imageorprintoptions-to-have-priority/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/set-defaultfont-property-of-pdfsaveoptions-and-imageorprintoptions-to-have-priority/</guid>
      <description>
        
        
        &lt;h2 id=&#34;possible-usage-scenarios&#34;&gt;&lt;strong&gt;Possible Usage Scenarios&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;While setting the &lt;strong&gt;DefaultFont&lt;/strong&gt; property of &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pdfsaveoptions/&#34;&gt;&lt;strong&gt;PdfSaveOptions&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions&lt;/strong&gt;&lt;/a&gt;, you might expect that saving to PDF or image would set that DefaultFont for all the text in a workbook that has a missing (not installed) font.&lt;/p&gt;
&lt;p&gt;Generally, when saving to PDF or image, Aspose.Cells will first try to set the Workbook&amp;rsquo;s default font (i.e., Workbook.DefaultStyle.Font). If the workbook&amp;rsquo;s default font still cannot show/render text properly, then Aspose.Cells will try to render with the font specified by the DefaultFont attribute in &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pdfsaveoptions/&#34;&gt;&lt;strong&gt;PdfSaveOptions&lt;/strong&gt;&lt;/a&gt;/&lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To address your expectation, we have a Boolean property named &lt;strong&gt;CheckWorkbookDefaultFont&lt;/strong&gt; in &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pdfsaveoptions/&#34;&gt;&lt;strong&gt;PdfSaveOptions&lt;/strong&gt;&lt;/a&gt;/&lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions&lt;/strong&gt;&lt;/a&gt;. You can set it to &lt;strong&gt;false&lt;/strong&gt; to disable trying the workbook&amp;rsquo;s default font, or let the &lt;strong&gt;DefaultFont&lt;/strong&gt; setting in &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pdfsaveoptions/&#34;&gt;&lt;strong&gt;PdfSaveOptions&lt;/strong&gt;&lt;/a&gt;/&lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions&lt;/strong&gt;&lt;/a&gt; have priority.&lt;/p&gt;
&lt;h2 id=&#34;set-defaultfont-property-of-pdfsaveoptionsimageorprintoptions&#34;&gt;&lt;strong&gt;Set DefaultFont property of PdfSaveOptions/ImageOrPrintOptions&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The following sample code opens an Excel file. The A1 cell (in the first worksheet) contains the text &lt;strong&gt;&amp;ldquo;Christmas Time Font text&amp;rdquo;&lt;/strong&gt;. The font name is &lt;strong&gt;&amp;ldquo;Christmas Time Personal Use&amp;rdquo;&lt;/strong&gt;, which is not installed on the machine. We set the &lt;strong&gt;DefaultFont&lt;/strong&gt; attribute of &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pdfsaveoptions/&#34;&gt;&lt;strong&gt;PdfSaveOptions&lt;/strong&gt;&lt;/a&gt;/&lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions&lt;/strong&gt;&lt;/a&gt; to &lt;strong&gt;&amp;ldquo;Times New Roman&amp;rdquo;&lt;/strong&gt;. We also set the &lt;strong&gt;CheckWorkbookDefaultFont&lt;/strong&gt; Boolean property to &lt;strong&gt;false&lt;/strong&gt;, which ensures that the text of the A1 cell is rendered with &lt;strong&gt;&amp;ldquo;Times New Roman&amp;rdquo;&lt;/strong&gt; and does not use the workbook&amp;rsquo;s default font (&lt;strong&gt;&amp;ldquo;Calibri&amp;rdquo;&lt;/strong&gt; in this case). The code renders the first worksheet to PNG and TIFF image formats and finally renders it to a PDF file format.&lt;/p&gt;


&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

The default value of the &lt;strong&gt;CheckWorkbookDefaultFont&lt;/strong&gt; attribute is &lt;strong&gt;true&lt;/strong&gt;.
&lt;/div&gt;

&lt;p&gt;This is the screenshot of the &lt;a href=&#34;49446913.xlsx&#34;&gt;template file&lt;/a&gt; used in the example code.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;set-defaultfont-property-of-pdfsaveoptions-and-imageorprintoptions-to-have-priority_1.png&#34; alt=&#34;todo:image_alt_text&#34;&gt;&lt;/p&gt;
&lt;p&gt;This is the output PNG image after setting the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property to &lt;strong&gt;&amp;ldquo;Times New Roman&amp;rdquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;set-defaultfont-property-of-pdfsaveoptions-and-imageorprintoptions-to-have-priority_2.png&#34; alt=&#34;todo:image_alt_text&#34;&gt;&lt;/p&gt;
&lt;p&gt;See the output &lt;a href=&#34;48496672.tiff&#34;&gt;TIFF&lt;/a&gt; image after setting the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property to &lt;strong&gt;&amp;ldquo;Times New Roman&amp;rdquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;See the output &lt;a href=&#34;48496673.pdf&#34;&gt;PDF&lt;/a&gt; file after setting the &lt;strong&gt;PdfSaveOptions&lt;/strong&gt; property to &lt;strong&gt;&amp;ldquo;Times New Roman&amp;rdquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;sample-code&#34;&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-SetDefaultfontPropertyOfPdfsaveoptionsAndImageorprintoptionsToHavePriority.go&#34;&gt;&lt;/script&gt;
&lt;br&gt;
&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Gocpp: Set Default Font while rendering spreadsheet to images with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/set-default-font-while-rendering-spreadsheet-to-images/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/set-default-font-while-rendering-spreadsheet-to-images/</guid>
      <description>
        
        
        

&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

Please use the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property to set the default font while rendering spreadsheets to images. This property will only be effective when the default font of the workbook cannot render the characters. The default font specified with &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property is used for all those cells which have invalid or non‑existent fonts.
&lt;/div&gt;

&lt;h2 id=&#34;set-default-font-while-rendering-spreadsheet-to-images&#34;&gt;Set Default Font while rendering spreadsheet to images&lt;/h2&gt;
&lt;p&gt;The following sample code creates a workbook, adds some text in cell A4 of the first worksheet, and sets its font to an invalid or non‑existent font. Then, it takes two images of the worksheet. The first image is generated by setting the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property to &lt;em&gt;Courier New&lt;/em&gt;, and the second image is generated by setting the same property to &lt;em&gt;Times New Roman&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This is the output image after setting the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property to &lt;em&gt;Courier New&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;set-default-font-while-rendering-spreadsheet-to-images_1.png&#34; alt=&#34;todo:image_alt_text&#34;&gt;&lt;/p&gt;
&lt;p&gt;This is the output image after setting the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/imageorprintoptions/getdefaultfont/&#34;&gt;&lt;strong&gt;ImageOrPrintOptions.GetDefaultFont()&lt;/strong&gt;&lt;/a&gt; property to &lt;em&gt;Times New Roman&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;set-default-font-while-rendering-spreadsheet-to-images_2.png&#34; alt=&#34;todo:image_alt_text&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;sample-code&#34;&gt;Sample Code&lt;/h2&gt;
&lt;p&gt;&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-SetDefaultFontWhileRenderingSpreadsheetToImages.go&#34;&gt;&lt;/script&gt;

&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;
&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
