-
-
Notifications
You must be signed in to change notification settings - Fork 47
Add .notdef glyph, etc. / dedicated glyph for U+0075 #82
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,11 +212,33 @@ def _accented(cp, base_name, mark_name, gap=20, x_adj=0): | |
| # Glyph aliases and re-uses | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # U+20DE COMBINING ENCLOSING SQUARE — zero-width mark sized and positioned to | ||
| # enclose '?' with a small margin. GPOS would be needed for full generality. | ||
| _sq = font[0x25A1] | ||
| _sq_bb = _sq.boundingBox() | ||
| _sq_cx = (_sq_bb[0] + _sq_bb[2]) / 2 | ||
| _sq_h = _sq_bb[3] - _sq_bb[1] # sq_bb[1] == 0 after baseline snap | ||
| _q_bb = font[ord('?')].boundingBox() | ||
| _q_adv = font[ord('?')].width | ||
| _margin = 20 | ||
| _scale_y = (_q_bb[3] - _q_bb[1] + 2 * _margin) / _sq_h | ||
| _x_offset = -_q_adv / 2 - _sq_cx | ||
| _y_offset = _q_bb[1] - _margin | ||
| c = font.createMappedChar(0x20DE) | ||
| c.addReference(_sq.glyphname, psMat.compose( | ||
| psMat.scale(1, _scale_y), | ||
| psMat.translate(_x_offset, _y_offset), | ||
| )) | ||
| c.width = 0 | ||
|
|
||
| # Vertical pipe: re-use the I glyph (same stroke, same weight). | ||
| c = font.createChar(-1, 'I.sansserif') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, it is true that this could be in pt4... is this what you meant @dummy-index?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove 'I.sansserif' in this PR for now. I just wanted to keep it on the mono side just in case. If the '<|' and '|>' in handwriting_minimal are supposed to mean bracket notation in the first place, they should be adopted as separate symbols rather than as ligatures; in other words, the bar glyph actually exists. It's just that it's too short, so it's tricky to decide whether to modify it. (Ideally, for positional relationships, it should be optimized to enclose lowercase letters like in XKCD 2034.)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to ship what we have in the PR - happy to discuss in a dedicated issue if we can improve the vertical pipe size 👍 |
||
| c.addReference('I') | ||
| c.width = font['I'].width | ||
| pipe = font.createMappedChar(ord('|')) | ||
| pipe.clear() | ||
| pipe.addReference('I') | ||
| pipe.width = font['I'].width | ||
| pipe.addReference('I.sansserif', psMat.compose(psMat.scale(1, 1.3), psMat.translate(0, -0.2 * font.ascent))) | ||
| pipe.width = font['I.sansserif'].width | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
pelson marked this conversation as resolved.
|
Uh oh!
There was an error while loading. Please reload this page.