Skip to content

Conversation

@davidflanagan
Copy link

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.

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.
@davidflanagan
Copy link
Author

The BoldSymbol screenshot test failed... I'm not sure why. I'll have to try running those locally.

@davidflanagan
Copy link
Author

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.

@davidflanagan
Copy link
Author

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
@kevinbarabash
Copy link
Member

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.

Which command are you running? make screenshots generates new screenshots, but dockers/Screenshotter/screenshotter.sh --verify is what's used to actually verify them. The latter reruns the test multiple times on failure to avoid issues with fonts not loading right away.

Copy link
Member

@kevinbarabash kevinbarabash left a 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.

const getCharacterMetrics = function(
character: string,
font: string,
mode: string,
Copy link
Member

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++) {
Copy link
Member

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.

@kevinbarabash kevinbarabash merged commit 853e2a4 into master Jan 22, 2018
@davidflanagan
Copy link
Author

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...

@ylemkimon ylemkimon deleted the support-extended-latin branch May 10, 2018 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants