help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set different fonts (question answered)


From: Nicholas Jankowski
Subject: Re: How to set different fonts (question answered)
Date: Fri, 30 Aug 2019 10:33:14 -0400

Assuming there might be users after you with similar questions, do you have a suggestion for revised documentation text that would have made this more clear/useful? 

On Fri, Aug 30, 2019 at 10:20 AM Brett Green <address@hidden> wrote:
I would like to be able to use a LaTeX math mode-like font for some plots. (I'm running Octave 5.1.0 on Windows 10.) The documentation at
https://octave.org/doc/interpreter/Text-Properties.html
suggests using the fontname property for this, but its instructions do not specify

Two suggestions came up when I searched. The first was just to use a font name, like
set(gca,"This Is A Font","defaulttextfontname","Helvetica")
This works, which is great.

The second was to give the directory and file like this:
title("This Is A Font","fontname","C:\Windows\Fonts\cambria.ttc")
While this doesn't return an error, it just prints the title with the default font.

In the end, all I had to do was
title("This Is A Font","fontname","Cambria Math")
and it worked. I had forgotten that I had not tried the simple string ("Cambria Math" here) with the property "fontname" intead of "defaulttextfontname".

I was surprised and impressed that I didn't need to specify a directory for an external font. Kudos to everyone who worked on this, and on Octave in general!

Though I was able to answer my question in the end, I wanted to submit this to the mailing list archives in case it could help someone else in the future.

- Brett Green


reply via email to

[Prev in Thread] Current Thread [Next in Thread]