Closed seghier closed 1 year ago
Please give the example of the formula you are rendering using this code.
Note that this system font setting only applies to the text section of the formula (i.e. when you use the text{ … }
command). Math section can only use hardcoded fonts for now, because the font metrics are impossible to extract automatically for now.
(I'll open a separate feature request, and we'll think of auto-expanding the metrics system to work with any text in formulas later, if your request is about that part; but, to figure that out, we need a formula example.)
Thank you Any simple formula for example:
\begin{align} x+1 &= y + 1 \\ x &= y-1 \end{align}
\binom{n}{k} = \frac{n!}{k!(n-k)!}
f(x) = \cases{1/3 & \mathrm{if} \thinspace 0\le x\le 1;\cr 2/3 & \mathrm{if} \thinspace 3\le x \le 4; \cr 0 &
\mathrm{elsewhere.}\cr}
I already create two plugins to use them in Rhinoceros 3D and Grasshopper, and i hope if there is a way to export the formula as svg or at least adding support for thin font, because create vector (svg or dxf) from thin font is easier in Rhino
For this formula, you can try something like this:
\text{f(x)} = \cases{\text{1/3} & \text{if 0 ≤ x ≤ 1;} \\
\text{2/3} & \text{if 3 ≤ x ≤ 4;} \\
\text{0} & \text{elsewhere.}}
So, I've opened a feature request #411 and found a bug #412 while typing that formula.
This request I consider as answered for now, but feel free to ask any additional questions!
Hi I change font in
var pngBytes = formula.RenderToPng(20.0, 0.0, 0.0, "Algerian");
But i don't see any change, why?
And can you add support for thin font like this one