export_fig can't do Monospace?

8 visualizaciones (últimos 30 días)
Shaun VanWeelden
Shaun VanWeelden el 3 de Nov. de 2013
Respondida: Oliver Woodford el 2 de En. de 2014
I have been using export_fig (#1 file on File Exchange) to generate a nice pdf report, but I have ran into something that seems absolutely ridiculous. I can't use monospace anything for a font.
I have tried specifying the MATLAB string to be of fonts "monospaced" and "courier new" and they both show up in the MATLAB figure correctly and print "more correctly" to a pdf when using the print function.
When I use the export_fig function it just completely disregards the fontname..
Some sample code is below:
uicontrol('style','text','position',[50 320 400 40],'string','Hello, why am I not monospaced in the PDF test2 and why does this 2 look awful in PDF test 1?','fontname','monospaced')
print(gcf,'-dpdf','test1.pdf')
export_fig('test2.pdf','-pdf')
To run export_fig, just go to File Exchange and its on the home page.
Would LaTex be a solution? I have never used it, but it seems like it may "trick" the renderer into displaying correctly.

Respuestas (1)

Oliver Woodford
Oliver Woodford el 2 de En. de 2014
Export_fig supports Courier, and that is monospaced.
For hints on why the other fonts you mentioned might not be working, see the "Known issues" section of the export_fig help page.

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by