Skip to content

Codex - Missing fonts in MATLAB when using Codex #32

Description

@endfreude

The font processing/embedding when exporting vector graphics from the Matlab session started via the MCP server is faulty. This causes multiple issues, e.g, exportgraphics does not use the defined font, ticklabels and secondarylabels are often not correctly aligned, font size is wrong.

Minimal example to reproduce:

figure;
plot([1 2],[3 4]);
exportgraphics(gcf,"test.pdf",ContentType="vector");

When you then inspect the resulting pdf file, the font embedding is wrong. It is exported in my case using "AdobeArabic-Regular" which seems to be some kind of fallback (this font is the first one in alphabetic order installed on my Windows PC) . Default would be "Helvetica" in the minimal example but the result is the same with different fonts (as defined using FontName properties).

Similar problems also arise for other vector formats (svg, emf) and for the related function copygraphics as well as the usage of these via the figure toolstrip/axes toolbar.

(I inspected the font embedding using Acrobat Reader: document properties > fonts)

My setup currently:

  • Matlab 2025b Update 4
  • Matlab MCP Server v0.5.1
  • Windows 11
Pinned by agoldsbo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions