Closed them3chanic closed 3 years ago
Found the answer after all:
@them3chanic - thanks for the update. Please let me know exactly what code changes you made and which export_fig parameters you've used to fix the problem, so that I could detect and correct such issues automatically within export_fig.
Hi Altmany,
MATLAB recognizes the Font as"Frutiger 45 Light". Ghostscript will find it with "Frutiger-Light". If you use the font and want to use the bold version, it would have to use "Frutiger-Bold". Your script tries to use Frutiger-Light-Bold, therefore I replaced it with:
export_fig('TestFile', fig1, '-eps', '-pdf', '-font_space', '', '-regexprep', 'Frutiger-Light-Bold', 'Frutiger-Bold');
I believe this is rather a workaround than a real bug fix. As you mentioned yourself in a code comment a real fix is a bit more sophisticated. One solution might be to get all fonts with "listfonts" and write an adaptive fontmap for ghostscript.
Maybe I missunderstood your argument "-nofontswap", but for me its works the other way around. Meaning that fonts are not swapped without it and swapped with the option active.
BR m3ch
Thanks, there's an automatic removal of "-Roman" from Times-Roman font names in print2eps line 488, but it's impossible to anticipate in advance all such replacements, and Frutiger is not as widely used as Times-Roman. Font replacements are one of the main reasons that I added the -regexprep
option to export_fig.
I agree that the -nofontswap
option is confusing, I'll consider improving the documentation.
@altmany it would be great if, in the case that a font is not identified and used, a warning is thrown for novice users to at least get some heads up about a failed attempt
Hi altmany,
thanks for your great work. I tried to get a custom font included with export_fig without any results. I'd like to include the font "Frutiger 45 Light" into my eps/pdf files, but I seem to encounter a bug:
-nofontswap
option, no font name is included into the eps file what so ever. As a result Courier is used as a standard font.Got any ideas what happens here? Shouldn't be there font names in the EPS file when I use the option
-nofontswap
?The Matlab code:
Best regards themech