Repository navigation
Add xBoundsAtY, yBoundsAtX to fontforge.glyph object (Python) - #4154
Conversation
This function also makes it so an optional layer argument can be passed to the `boundingBox` function of `fontforge.glyph` objects. New tests are added, for all of our sanity. This is the first time I've added new tests (after years of contributions, pretty scary right? haha).
| if (layerp2 != NULL) { | ||
| if (layeri != i) continue; | ||
| } | ||
| SplineSet* ss = LayerAllSplines(&self->sc->layers[i]); |
There was a problem hiding this comment.
So if I'm understanding right RefChar.layers[layer].splines is a copy of the contours from the referenced glyph but already transformed? That does make things easier.
There was a problem hiding this comment.
You are indeed understanding right. :-)
There was a problem hiding this comment.
In case you want some proof of this, and for posterity, here is a test script:
import fontforge
f = fontforge.fonts()[0]
print( f["A"].xBoundsAtY(600, layer=1) )
print( f["B"].xBoundsAtY(600, layer=1) )Returns:
(400.6141304347826, 463.64921465968587)
(567.7201033882473, 630.7551691344895)For file:
tri.zip: Zip archive data, at least v2.0 to extract
UEsDBBQAAgAIABqJTFC2XJKQdwIAAMMEAAAHAAAAdHJpLnNmZG1T227iMBB991dYvLSVFmo7OIS8
cd0i0VI1pay0Wq2sxAlWjY0StxX79TtOuLYVATJnZo6Px8fJVisjp9a48TDGQYch//4gNjLGS+OU
0zKjaPqm9RdMbJTefUZXUhVrF+MnWbxpUaKR3e7KBjq+4uv0BjPCyA9ofDX2w6DlyG420rgqxi2f
abM2ZdBSSuFkhj+UW2MvbGrLQuLrtXPb+PY2ByT3SAd+blroRZaVsibGhNAOIQTNnNAqHZhCg0iC
liaTpd/vo62UqyvblJzhK5W5dYw5QYMqBTkxjiA9lvuAeUrzDpzZZOMJ52Iny5F9q5NNBDB8WkOR
vrYwPWDUYyBetqDr13I2jvFvShjFIeeYh6CX9HqYsijkYRT8QYuEnTbjo7/NYGuBibZbuTB6d8gt
K/m829p76UqVwggpqgcH3c/KHw/lEe324UvQvc1UrtKvyYBwz+V5DnsnR2CR55V0nniPHEdyrBl/
qZnDQAux3deslLng9fFFCwCXrB44VdytpchODE34KX3W38QXC7xIk1k4i6vHfJJdofFkFuM+pYyj
iUlhLKaI8SxZRBHvtyl4QgEoZ8bJEvZgrJHIm32uKiAc/JyDH0v8ID9qX1ZorKqtFrtE/YOZtnsM
DeBODLQS9XlMlXu2jWdgWzOT2xiHXRyBa4ayUGa0FiUUMh4CghInSuchWOhMXMj94xlql1Lv8KkW
BTTefbKitxpK6rudSIfAalDO8QazPsLdwBP1sIb1EO6xAEfdfXAo1L5wYrITBQRe0YW44bm40D/0
W3Gr79Q9yby5LbCnh/qCkA4P+oR3IWhTHnYCFgLKjkvv/6uTMD969B9QSwECPwMUAAIACAAaiUxQ
tlySkHcCAADDBAAABwAAAAAAAAAAAAAApIEAAAAAdHJpLnNmZFBLBQYAAAAAAQABADUAAACcAgAA
AAA=
Sorry about the base64, GitHub is refusing to upload it. 🙄
|
Hey @ctrlcctrlv from upstream, I believe the messages are gone now. |
|
@ViliusSutkus89 No problem, I was quite sure it was accidental, and had no idea why it was happening either :-) I imagine someone at GitHub is smiling to themselves as their feature is "getting fork maintainers talking" and "increasing developer engagement", meanwhile all the comments are simply bewildered "why should a reversion on his personal fork show up here if he's not asking us to revert it upstream (as I originally thought when seeing GitHub's message)?" That's social media for you. Cheers. |
…orge#4154) * Add xBoundsAtY, yBoundsAtX to fontforge.glyph objects (Python) This patch also makes it so an optional layer argument can be passed to the `boundingBox` function of `fontforge.glyph` objects. New tests are added, for all of our sanity. This is the first time I've added new tests after years of contributions, pretty scary right? Haha.
This patch also makes it so an optional layer argument can be passed
to the
boundingBoxfunction offontforge.glyphobjects.New tests are added, for all of our sanity. This is the first time I've
added new tests (after years of contributions, pretty scary right? haha).
This closes #4151.
This is yet another blocker on #703.
Type of change