-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support more scripts in \text{} environments. #1076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This diff is a follow-up to PR #1060 which added support for Indic scripts. In order to support Czech, Turkish and Hungarian text (at least) inside \text{} environments, we need to recognize the Latin Extended A and B Unicode blocks. The patch also adds support for Georgian, and enhances support for Cyrillic by defining the entire Cyrillic unicode block instead of defining symbols for a subset of Cyrillic letters as we did previously.
|
The BoldSymbol screenshot test failed... I'm not sure why. I'll have to try running those locally. |
|
The BoldSymbol screenshot failure has to do with the rendering of the (turkish) dotless i. In the original it is a curvy script i, but with this patch it becomes a straight sans-serif i. That seems like a regression, not an improvement! The screenshot tests are hard, though: running them locally, I get a number of failures even on the master branch where I haven't changed anything. |
|
Somehow with this patch the \boldsymbol\imath is rendered with css classes "mord boldsymbol latin_fallback" instead of "mord mathbf" as it is on master. The latin_fallback is expected and does nothing, but boldsymbol instead of mathbf is a problem: it changes the font from Katex_Main to Katex_Math, and adds font-style:italic |
The Unicode scripts listed in unicodeScripts.js are supported in text mode but getCharacterMetrics() was returning fake metrics for them even in math mode. This caused bad handling of \boldsymbol\imath
Which command are you running? |
kevinbarabash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. One minor nit in the comments.
src/fontMetrics.js
Outdated
| const getCharacterMetrics = function( | ||
| character: string, | ||
| font: string, | ||
| mode: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Mode from types.js.
|
|
||
| it("scriptFromCodepoint() should return correct values", () => { | ||
| for (let codepoint = 0; codepoint <= 0xffff; codepoint++) { | ||
| outer: for (let codepoint = 0; codepoint <= 0xffff; codepoint++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just reading a blogpost today about little known JS features today and labels was one of the things in the blogpost.
|
Thanks, Kevin for merging for using the Mode type. It turns out that my problem with running the screenshot tests locally was that didn't clone the repo recursively when I started, so I didn't have the fonts submodule... |
This diff is a follow-up to PR #1060 which added support for Indic scripts.
In order to support Czech, Turkish and Hungarian text (at least) inside
\text{} environments, we need to recognize the Latin Extended A and B
Unicode blocks. The patch also adds support for Georgian, and enhances
support for Cyrillic by defining the entire Cyrillic unicode block instead
of defining symbols for a subset of Cyrillic letters as we did previously.