在 Quartz (iPhone SDK) 中绘制(打印 - 不是图表)方程

发布于 2024-09-08 02:39:49 字数 394 浏览 1 评论 0原文

我正在尝试在屏幕上绘制方程式。不是图表或其他东西,只是方程式,而是以一种“漂亮”的方式(就像它们在维基百科上看到的那样)。 我做了一些研究,但可以找到一种“内置方式”,但也许我忽略了一些东西?!?

所以我决定自己画它们。我经验不足,所以如果我的想法完全白痴,请不要责怪我......

我想到了两种方法。要么我在公式中创建一个 UIView 子类作为字符串,解析它并处理该视图中的所有绘图。或者我为每种类型的数学表达式创建单独的子类,并提交适当的部分(fe 分子和分数的分母)。这些部分可以是这些子类中的任何一个...如果(平方)根子类会将部分放在根下,并以适当的大小在适当的位置绘制根符号...

是其中一种方法有什么好处吗?或者如果有人知道更好/更简单的方法来解决这个问题,请告诉我。

会对我有很大帮助, 谢谢

I'm trying to draw equations to the screen. Not the graphs or sth just the equation, but in a "pretty" way (f.e. like they look on wikipedia ).
I've done some research but could find a "build-in-way", but maybe i overlooked something?!?

So i've decided to draw them by myself. I'm not very experienced, so don't blaim me if my idea is completely idiotic...

I thought of two ways. Either i create one UIView subclass hand in the formula as string, parse it and handle all the drawing in that view. Or i create individual subclasses for each type of mathematical expression and hand in the apropriate parts (f.e numerator and denominator for a fraction). and those parts can be either of those subclasses... f.e. a (square)-root-subclass would get the part under the root and draws the root-sign at the appropriate place in the appropriate size...

is one of this ways any good? or if some knows an better/easier way to solve this, pls let me know.

would help me alot,
thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

当梦初醒 2024-09-15 02:39:49

只需将 MathML 表达式 倒入 UIWebView 中即可。

Just pour a MathML expression into a UIWebView.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文