Why does MATLAB use the default Helvetica font when certain True Type fonts are chosen for a text object in my MATLAB figure?

135 次查看(过去 30 天)
Why does MATLAB use the default Helvetica font when certain True Type fonts are chosen for a text object in my MATLAB figure?
I downloaded three True Type fonts called SIL Doulos, SIL Sophia, and SIL Manuscript, that produce IPA (International Phonetic Alphabet) symbols. I placed the fonts in the proper system folder as required by the operating system. These fonts work fine in other applications such as Microsoft Word. When I produce a text object in a MATLAB figure, these fonts are listed as fonts in the property editor for the text object, but the default Helvetica font is used by MATLAB if they are chosen.

采纳的回答

MathWorks Support Team
The font names that MATLAB uses in the property editor must be spelled the same as the names used for the font files that are used by the operating system. For example, the font files associated with SIL Sophia are called
SIL Sophia IPA93
SIL Sophia IPA93 Bold
SIL Sophia IPA93 Italic
and they are located in the 'C:\WINNT\Fonts' folder on a Windows 2000 machine. However, in the MATLAB property editor for the text object, this font is spelled 'SIL Sophia IPA'. When this font is chosen, the default Helvetica font is used because MATLAB does not recognize the font due to the incorrect spelling of the name in the property editor.
To correct the spelling of the font names in the MATLAB property editor, you need to edit 'listfonts.m' by performing the following steps:
1) Type 'edit listfonts' in your MATLAB command window
2) Several fonts are listed beginning around line 86 of this file. Add the desired fonts, making sure to spell them exactly as they appear in the font files.
3) Save 'listfonts.m' and restart MATLAB.
You should now be able to use these fonts for the text object in the figure.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by