When I run the following code, only the line "asdfrandom font" appears in the png output.
I compiled & installed mathgl 2.2.2.1 into a mac running OS X 10.9.3 Mavericks.
We have a workaround in the code (i.e., loading a non-existent font when compiled for a mac), but we prefer to use the default font.
Could you please advise the correct solution? Thanks.
#include<iostream>#include<cstdlib>#include<mgl2/canvas_wnd.h>usingnamespacestd;voidsmgl_fonts(mglGraph*gr)// font typefaces{doubleh=1.1,d=0.25;gr->LoadFont("STIX");gr->Puts(mglPoint(0,h),"default font (STIX)");gr->LoadFont("asdfrandom");gr->Puts(mglPoint(0,h-d),"asdfrandom font");}intmain(){unsignedintw=1024,h=768;mglGraph*grS;grS=newmglGraph(0,w,h);smgl_fonts(grS);grS->WritePNG("result.png");deletegrS;return0;}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm, both lines appears. However, the second line (i.e. "asdfrandom font") still use STIX font (default one) because I have no "asdfrandom" font.
For example, following function will produce the output in the attachment. This is the same function as yours with added line to test other font loading (i.e. "bonum" font which can be downloaded from MathGL).
Hi,
When I run the following code, only the line "asdfrandom font" appears in the png output.
I compiled & installed mathgl 2.2.2.1 into a mac running OS X 10.9.3 Mavericks.
We have a workaround in the code (i.e., loading a non-existent font when compiled for a mac), but we prefer to use the default font.
Could you please advise the correct solution? Thanks.
Hmm, both lines appears. However, the second line (i.e. "asdfrandom font") still use STIX font (default one) because I have no "asdfrandom" font.
For example, following function will produce the output in the attachment. This is the same function as yours with added line to test other font loading (i.e. "bonum" font which can be downloaded from MathGL).
Hi,
This is the result.png that I get from my original code (notice it only has 1 line of text, not 2)