While copying styles from 1 document to the other we noticed that the font of the new styles aren’t right.
After searching we found that Style inheritance isn’t working as expected.
If you set the default style settings (Styles -> Manage styles -> Set Default) to a font (Georgia in my sample), and set the normal style to another font (for example Calibri)
Styles without font and inheriting Normal (Intensive reference), get set as Georgia instead of Calibri with Aspose.
To check this I created a small application witch lists all styles with its font name.
All styles without font and inheritance, get set to the font of the defaults instead of the font of the inheriting style.
Grtz,
Kris
Hi Kris,
Thanks for your inquiry. The character style “Intense Reference” is actually based on “Default Paragraph Font” and the font specified for “Default Paragraph Font” style is “Georgia” that is why Aspose.Words formats the text with “Georgia” font instead of “Calibri”. This is the expected behaviour i.e. if you don’t specify a font name to a style, the font name of the parent style (this style is based on) is used. Please let me know if I can be of any further assistance.
Best regards,
Hi,
My description was indeed not 100% accurate, “Intense Reference” is indeed based on “Default Paragraph Font”, yet this style is also “Calibri” (Looked at it at “manage styles” in Word 2010/2013).
The font set at “Set Defaults” is “Georgia”, yet Aspose.Words takes this value instead of that from “Default Paragraph Font”
I mostly tested this behavior by setting text to “Webdings” and then setting the style to “Intensive Reference”.
Word sets the font then back to “Calibri” and not to “Georgia”.
Kind regards,
Kris
Hi Kris,
Thanks for your inquiry. I am checking with this scenario and will get back to you soon.
Best regards,
Any news on this issue ?
Thanks
Kris
Hi Kris,
Thanks for being patient. The “Default Paragraph Font” is a “special” style in Word; it represents the default font of any given style. I think, you can specify Font name for this style (DPF) by going through (Styles → Manage Styles → Set Default). In this case, Aspose.Words reads the default values specified under “SetDefaults” tab. For more information about “Default Paragraph Font”, please visit the following link:
https://wordmvp.com/FAQs/Customization/DefParaFont.htm
Best regards,
Hi,
I understand “Default Paragraph Format” (DPF) and the “Defaults” are 2 different things and work in a special way.
Yet as I, and customers see it, Aspose.Words doesn’t work the same way as Word does.
The format gets set to the wrong values and thus the document is “completely” wrong for the customer.
So my question is: Can the behavior be changed/fixed in Aspose.Words?
Or at least is there any way to detect this so it can be bypassed ?
Kind regards
Kris
Hi Kris,
Thanks for your inquiry.
When producing an output Word document by using the following code, yes the font of text “INTENSE REFERENSE” is changed to “Georgia” instead it should remain be preserved i.e. “Calibri”. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-8863. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.
Code used to reproduce the issue:
Document dst = new Document();
Document src = new Document(@"C:\Temp\styles.docx");
dst.AppendDocument(src, ImportFormatMode.KeepSourceFormatting);
dst.Save(@"C:\Temp\out.docx");
Best regards,
The issues you have found earlier (filed as WORDSNET-8863) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan