Missing Fonts When Printing from the Cloud
This Section Describes how to install temporary fonts during a report generation when trying to render a report with a font that is not pre-installed on Alpha Cloud.
Create a fonts folder under the web project.
From the Web Control Panel, click All Files and then select File/New Folder from the window menu.
Enter "Fonts" as the name of the folder and add the folder.
It should show up as a folder on the Web Control Panel.
Manually add each of the fonts you want to make available into the Fonts folder.
Add the scripts below to your Xbasic web project code as described above (adjust the font names to match those fonts you want to install).
Republish and deploy your web project to Alpha Cloud.
Add a snippet of code to Xbasic sometime before your report is printed.
The code shows an example of installing the Arial Narrow Fonts, You will need to change the code to reflect the specific fonts you copied into the fonts folder.
if Context.ApplicationConfiguration.ServerProduct = "AlphaCloud" dim sv as dotnet::Services dim ay as dotnet::assemblyreference ay.Name = "System.Drawing" ay.Version = "22.214.171.124" ay.Culture = "neutral" ay.PublicKeyToken = "b03f5f7f11d50a3a" if sv.registerassembly("::", ay) dim pfc as System::Drawing::Text::PrivateFontCollection on error goto added pfc.AddFontFile(Context.Request.ApplicationRoot + "\fonts\arialn.ttf") pfc.AddFontFile(Context.Request.ApplicationRoot + "\fonts\arialnb.ttf") pfc.AddFontFile(Context.Request.ApplicationRoot + "\fonts\arialnbi.ttf") pfc.AddFontFile(Context.Request.ApplicationRoot + "\fonts\arialni.ttf") pfc.AddFontFile(Context.Request.ApplicationRoot + "\fonts\arialuni.ttf") end if added: end if