Why do I get warning about Common Hyphenation while creating pdf with MATLAB Report Generator?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 14 Sep 2020
Edited: MathWorks Support Team
on 31 Jan 2025
I am generating a pdf using MATLAB Report Generator. In my code, I specified 'Helvetica' as FontFamily for a table header.
import mlreportgen.dom.*
t = Table();
t.TableEntriesStyle = { FontFamily('Helvetica') };
I am getting the following warning. However, the warning does not affect the desired output and the pdf is generated appropriately.
[WARN] CommonHyphenation - Substituted specified hyphenation character (0x200b) with 0x20 because the font doesn't have the specified hyphenation character: Helvetica,normal,400
Please explain what is the root cause of this warning and how to suppress it. I am using MATLAB R2019b.
Accepted Answer
MathWorks Support Team
on 25 Jan 2025
Edited: MathWorks Support Team
on 31 Jan 2025
This is an expected behavior while using the DOM API. ‘mlreportgen.dom.Table’ uses a zero-width space (character x200b) as its hyphenation character. If a user-specified font (‘Helvetica’ in your case) does not have this character, MATLAB will replace that character using one of our built-in backup fonts (Noto Sans, Noto Sans CJK JP, Noto Sans CJK KR, Noto Sans CJK SC, Noto Emoji), which do have this character. This warning is appearing to inform you about this font change.
Try specifying one of the backup fonts (Noto Sans, Noto Sans CJK JP, Noto Sans CJK KR, Noto Sans CJK SC, Noto Emoji) and check if the warning still exists.
The warning itself does not affect the execution of code and the output. If desired, you can suppress this warning by following the procedure mentioned in the "Suppress Warnings" documentation. Execute the following command in the MATLAB R2019b Command Window to access the release-specific documentation:
>> web(fullfile(docroot, 'matlab/matlab_prog/suppress-warnings.html'))
Please follow the below link to search for the required information regarding the current release:
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!