Title: Having some trouble with vertical alignment · Issue #17 · treeform/pixie-python · GitHub
Open Graph Title: Having some trouble with vertical alignment · Issue #17 · treeform/pixie-python
X Title: Having some trouble with vertical alignment · Issue #17 · treeform/pixie-python
Description: I'm trying to have some text with two lines, aligned to the bottom of some bounds, and with a small line-height so that the two lines are closer together. However the text is not going where I would expect. It looks like it's going too d...
Open Graph Description: I'm trying to have some text with two lines, aligned to the bottom of some bounds, and with a small line-height so that the two lines are closer together. However the text is not going where I woul...
X Description: I'm trying to have some text with two lines, aligned to the bottom of some bounds, and with a small line-height so that the two lines are closer together. However the text is not going where I ...
Opengraph URL: https://github.com/treeform/pixie-python/issues/17
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Having some trouble with vertical alignment","articleBody":"I'm trying to have some text with two lines, aligned to the bottom of some bounds, and with a small line-height so that the two lines are closer together. However the text is not going where I would expect. It looks like it's going too downwards. When aligned to bottom it even goes outside the bounds. If I leave the line-height to default it also doesn't look right.\r\nAm I missing something?\r\n\r\nHere's an example and it's output:\r\n\r\n```python\r\nimport pixie\r\n\r\nimage = pixie.Image(800, 800)\r\nimage.fill(pixie.Color(1, 1, 1, 1))\r\n\r\npaint = pixie.Paint(pixie.PK_SOLID)\r\npaint.color = pixie.Color(1, 0, 0, 1)\r\nctx = image.new_context()\r\nctx.line_width = 1\r\nctx.stroke_style = paint\r\nctx.stroke_rect(0, 266, 800, 318)\r\n\r\ntext = \"AbCd\\naBcD\"\r\n\r\nfont = pixie.read_font(\"./Inter-Bold.otf\")\r\nfont.size = 182\r\nfont.line_height = 140\r\n\r\nfont.paint.color = pixie.Color(1, 0, 0, 1)\r\nimage.fill_text(\r\n font,\r\n text,\r\n bounds = pixie.Vector2(800, 318),\r\n h_align = pixie.HA_CENTER,\r\n v_align = pixie.VA_TOP,\r\n transform = pixie.translate(0, 266)\r\n)\r\n\r\nfont.paint.color = pixie.Color(0, 1, 0, 1)\r\nimage.fill_text(\r\n font,\r\n text,\r\n bounds = pixie.Vector2(800, 318),\r\n h_align = pixie.HA_CENTER,\r\n v_align = pixie.VA_MIDDLE,\r\n transform = pixie.translate(0, 266)\r\n)\r\n\r\nfont.paint.color = pixie.Color(0, 0, 1, 1)\r\nimage.fill_text(\r\n font,\r\n text,\r\n bounds = pixie.Vector2(800, 318),\r\n h_align = pixie.HA_CENTER,\r\n v_align = pixie.VA_BOTTOM,\r\n transform = pixie.translate(0, 266)\r\n)\r\n\r\nimage.write_file(\"out.png\")\r\n```\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/EnricoMonese","@type":"Person","name":"EnricoMonese"},"datePublished":"2022-02-19T11:57:37Z","url":"https://github.com/treeform/pixie-python/issues/17"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e055804e-14ad-ce39-bb6c-6d73143aacbd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2E0:E08F0:A488DC:E65168:6B048A9B |
| html-safe-nonce | 181f2803129b0bda88df3af9d7256843f5070b16bcf8bf02928efd05233db9c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkUwOkUwOEYwOkE0ODhEQzpFNjUxNjg6NkIwNDhBOUIiLCJ2aXNpdG9yX2lkIjoiMTc4NTQ1NDM0OTU0MDE2NjI5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a547ba637ee4ec1e7b0763c07e2b7842f7f5c54cc6bff843d6ab9a7a764bd04a |
| hovercard-subject-tag | issue:1144676039 |
| github-keyboard-shortcuts | repository,source-code,file-tree,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/treeform/pixie-python/17/issue_layout |
| twitter:image | https://opengraph.githubassets.com/50418fa88cf3bb09d510442b9f36e59470d7f0466a5e1426e8a2c429b4365f2e/treeform/pixie-python/issues/17 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/50418fa88cf3bb09d510442b9f36e59470d7f0466a5e1426e8a2c429b4365f2e/treeform/pixie-python/issues/17 |
| og:image:alt | I'm trying to have some text with two lines, aligned to the bottom of some bounds, and with a small line-height so that the two lines are closer together. However the text is not going where I woul... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EnricoMonese |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| turbo-cache-control | no-preview |
| go-import | github.com/treeform/pixie-python git https://github.com/treeform/pixie-python.git |
| octolytics-dimension-user_id | 125948 |
| octolytics-dimension-user_login | treeform |
| octolytics-dimension-repository_id | 399247825 |
| octolytics-dimension-repository_nwo | treeform/pixie-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 399247825 |
| octolytics-dimension-repository_network_root_nwo | treeform/pixie-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width