Skip to content
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

Cleanup makeOrd Function #1175

Open
ry-randall opened this issue Feb 19, 2018 · 7 comments
Open

Cleanup makeOrd Function #1175

ry-randall opened this issue Feb 19, 2018 · 7 comments
Assignees

Comments

@ry-randall
Copy link
Member

Currently the makeOrd function does too much. The purpose of this is to clean it up and make it more readable.

From: #1111

@kevinbarabash
Copy link
Member

@rrandallcainc this probably doesn't fit within the scope of what you were thinking of but someday it would be nice if we had an IR were the ord nodes contained exactly what font each character should be rendered as.

@edemaine
Copy link
Member

@kevinbarabash Perhaps a function that maps the various font properties from #1111 into that actual font would be just as good, and perhaps the main role of makeOrd? I've forgotten the details, but every time I look at the font choice code (and e.g. mathDefault) I feel like they are very confusing, possibly wrong, and could be improved.

@kevinbarabash
Copy link
Member

I think if we split it up into two mappings that may simplify things. Those two mappings might be:

  • current options, character => family, weight, style
  • family, weight, style, character => actually CSS class for that font

@edemaine
Copy link
Member

Mapping to CSS classes may also require knowing the parent CSS classes, to avoid repetition. Or maybe that's a third step, checking how your desired CSS class differs from the parent and thus what needs specifying.

@ry-randall
Copy link
Member Author

ry-randall commented Feb 20, 2018

@edemaine By a function that maps the various properties, were you referring to something like this? https://github.com/Khan/KaTeX/blob/master/src/buildCommon.js#L601

@kevinbarabash I'm a little fuzzy on what you mean by "IR were the ord nodes contained exactly what font each character should be rendered as.". Are you referring to something like: render "hello" as SansSerif-Bold?

@ry-randall ry-randall self-assigned this Mar 28, 2018
@ry-randall
Copy link
Member Author

It's been a little while since opening this. I'll start taking a look at this.

@kevinbarabash
Copy link
Member

@kevinbarabash I'm a little fuzzy on what you mean by "IR were the ord nodes contained exactly what font each character should be rendered as.". Are you referring to something like: render "hello" as SansSerif-Bold?

I was thinking that each character within the IR would have a specific font style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants