Repository navigation
Add expression evaluation to numeric metrics fields in selection info - #2237
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #2236.
This introduces an inline calculator in the metrics fields in the selection info panel. It evaluates to a concrete value once you type enter or leave the field.
It supports most common operators and parentheses.
Additionally it allows to use glyph names as variable names, to refer to the metrics value for that glyph. For example, if you type
Ein the advance width field, it will take the advance width of theEglyph and put that in the field. Likewise, if you typeEin the left sidebearing field, it will put the left sidebearing value from theEglyph in the field. But glyph names can also be used as part of an expression, for exampleE + 10.There is a special notation for the opposite sidebearing, by adding a
!to the glyph name: if in the left sidebearing field you useE!in the expression, it will take the right sidebearing fromE.