Azure function is different from an Azure application. i have already read this documentation. you should test this application on Azure Functions.
For the dynamic font question i am asking if it is possible to swap a font if there is a warning thrown for a missing font. The defaultfontname property doesn’t work in the system folder path.
This situation is very urgent because of this strange behaviour: We have verified that the system path to the fonts is correct and Aspose is pointing to that font. In our case that path is : D:/Windows/Fonts. Now if aspose encounters a font not present on the system it will try and default to Times New Roman, however, what we are seeing is that it defaults to Comic Sans.
Is there any behaviour in Aspose that it would get fonts from elsewhere if not previously defined to do so? Also why does it pick Comic Sans if Times new Roman is not found? I am going to engage the Microsoft Azure Function team and your team to figure out where the failure is occurring.
We have also noticed that when we copy all the system fonts to a folder in our function and we tell Aspose to target that folder that everything works fine. Could you please check your default system folder font logic for us and let us know if there is behaviour we have not accounted for?
Could you please clarify this comment:
// If the default font defined here cannot be found during rendering then the closest font on the machine is used instead.
where is it looking for the default font before it looks for the font in the machine?
WORDSNET-4316: Font Substitution Mechanism Improved
Previously Aspose.Words performed font substitution only in cases when FontInfo in the document for the missing font doesn’t contains the PANOSE. Now Aspose.Words evaluates all related fields in FontInfo (Panose, Sig etc) and finds the closest match among the available font sources. In case of font substitution the warning is issued with text:
“Font ‘<font_name>’ has not been found. Using ‘<substitution_name>’ font instead. Reason: closest match according to font info from the document.”
Please note that now font substitution mechanism will override the FontSettings.DefaultFontName in cases when FontInfo for the missing font is available in the document. FontSettings.DefaultFontName will be used only in cases when there are no FontInfo for the missing font.
Also please note that font substitution algorithm in MS Word is not documented. And the result of Aspose.Words font substitution may not match MS Word choice.
This sounds like buggy feature, in our case it is relating Garamond to Comic Sans. is there a way this can be improved to include a font within the font family ? it doesn’t make sense for the algorithm to not consider the specified DefaultFontName. having Comic Sans in place of Garamond is a HUGE difference for a resume displayed to a recruiter as this font is considered a faux pas!
Whats weird is how this behaviour does not occur if the fonts are in a different folder. this is quite strange.