-
Notifications
You must be signed in to change notification settings - Fork 44
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
Basic analysis of the script content of strings #764
Conversation
94: "Tai_Le", | ||
95: "New_Tai_Lue", |
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.
These were changed to match the names in kiva.fonttools.text._data
.
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.
LGTM
|
||
def _lookup_codepoint(self, cp): | ||
comps = self.ranges - ord(cp) | ||
index = ((comps[:, 0] <= 0) == (comps[:, 1] >= 0)).argmax() |
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.
This looks like the most important detail in the PR - how we're selecting the entry given a code point - and it'd be useful if you could elaborate on how we're doing it.
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.
Fair enough
still LGTM |
Thanks for the review |
This is another part of #762
There are two pieces here, and a ton of machine-generated code (don't fear the diff):
kiva.fonttools.text._data
module.UnicodeAnalyzer
which uses the data fromScripts.txt
and returns the languages and slices for a given input string.UnicodeAnalyzer
is pretty basic right now. I'd like to keep it that way in this PR. For instance, Emoji ligatures are not great: