Add support for math text glyphs - #13612
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## branch-3.4 #13612 +/- ##
===========================================
Coverage 92.53% 92.54%
===========================================
Files 323 323
Lines 20476 20493 +17
===========================================
+ Hits 18948 18965 +17
Misses 1528 1528 |
|
@mattpap The images and animations you often include in PRs are really great, but FYI I'm usually left wishing the code that generated them was available in order to try things out or experiment with the API. |
942a6ac to
f8c4832
Compare
| export {Glyph} from "./glyph" | ||
| export {HArea} from "./harea" | ||
| export {HAreaStep} from "./harea_step" | ||
| export {HArea} from "./harea" |
There was a problem hiding this comment.
I don't understand these re-orderings
In [4]: "HArea" < "HAreaStep"
Out[4]: True
There was a problem hiding this comment.
I use vim's (or equivalent) :sort command, which is non-semantic, thus it compares S < }.
There was a problem hiding this comment.
I resorted this the way eslint would. At some point, when there are fewer open PRs, I will most likely enable relevant lint rules to systematically organize imports and exports.
|
Generally LGTM, a couple of comments/questions:
Lastly, folks have at times asked for a unified text API that supports math text inside using |
Not necessarily. However, I didn't want to further bloat |
f8c4832 to
5c4e1a9
Compare
There aren't many possibilities when dealing with naming conflicts:
For the purpose of this PR the first seems to be the simplest to go with, especially that an average user will use |
Co-authored-by: Moritz Schreiber <68053396+mosc9575@users.noreply.github.com>
OT: We are adding enough new models that it's reasonable to consider. Like I said in the other issue, we just need to have a detailed and specific actual plan that is agreed up front. I would say we have one shot to define a hierarchy structure for models to slot into, so we need to be deliberate about the conceptual basis for that structure, how it might be extended, in the future, how documentation will adapt, etc. And also how to handle a smooth transition period (for at least a few years I would guess). |
* Add support for math text glyphs * Fix docstring layout and spelling Co-authored-by: Moritz Schreiber <68053396+mosc9575@users.noreply.github.com> * add rst files for new glyphes --------- Co-authored-by: Moritz Schreiber <68053396+mosc9575@users.noreply.github.com> Co-authored-by: Moritz Schreiber <moritz.schreiber@ifesca.de>
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This adds support for
TeXGlyphandMathMLGlyph, which mirror functionality ofTeXandMathMLmodels (thusGlyphsuffix), but for vectorized inputs. I also addedtex()andmathml()methods to glyph APIs (infigure). From performance perspective this may not be the best implementation for the time being, but at least it guarantees no flickering. Alternatively I would have to go theImageURLroute, which isn't great either.TeXGlyphsupports three display modes:"auto"(the default), wheretext's values are parsed, requiring TeX delimiters to enclose math content, e.g.$$x^2$$. TeX display mode is inferred by the parser."block", wheretext's values are taken verbatim and TeX's block mode is used."inline", wheretext's values are taken verbatim and TeX's inline mode is used.Exmple: (

inline,blockdisplay, and normalTextglyph for comparison):Python: