{"full_name":"chenglou/pretext","owner":"chenglou","name":"pretext","url":"https://github.com/chenglou/pretext","description":"Fast, accurate & comprehensive text measurement & layout","homepage":"http://chenglou.me/pretext/","topics":[],"language":"TypeScript","license":"NOASSERTION","avatar":"https://avatars.githubusercontent.com/u/1909539?u=92b43968b7ba8d33483aaee60f5d9356d90f4690&v=4","created_at":"2026-03-07T21:06:28Z","pushed_at":"2026-10-15T17:09:24Z","metrics":{"stars":51024,"forks":2759,"watchers":133,"issues":141,"prs":384,"releases":1,"issues_open":null,"issues_closed":null,"prs_open":null,"prs_closed":null,"prs_merged":null,"discussions":0},"growth":{"day":{"stars":7,"forks":0,"base_day":"2026-11-09"}},"history":{"dates":["2026-11-09","2026-11-10"],"stars":[51017,51024],"forks":[2759,2759],"watchers":[133,133],"issues_open":[null,null],"prs_open":[null,null]},"boards":{},"same_owner":[],"issues":[{"number":107,"title":"Canvas doesn't account for `letter-spacing`, `font-optical-sizing` and `font-feature-settings`","comments":12,"created_at":"2026-04-05T16:47:43Z"},{"number":123,"title":"Server Side Rendering (SSR) support","comments":10,"created_at":"2026-04-10T20:40:29Z"},{"number":151,"title":"Many weird behaviours with text selection","comments":7,"created_at":"2026-04-20T19:53:08Z"},{"number":6,"title":"For fun: \"Auto-researched\" performance optimizations (analysis + bidi + layout)","comments":7,"created_at":"2026-03-29T01:45:23Z"},{"number":382,"title":"Rich pre-wrap: tab stops and wrapped padding need info prepareRichInline doesn't have","comments":4,"created_at":"2026-09-29T23:20:20Z"},{"number":8,"title":"usage guide needed !","comments":4,"created_at":"2026-03-29T06:53:24Z"},{"number":1,"title":"Request: vertical-rtl","comments":4,"created_at":"2026-03-28T04:28:39Z"},{"number":334,"title":"Is there a supported fallback when `layout()` undercounts browser lines?","comments":3,"created_at":"2026-09-17T09:51:31Z"}],"discussions":[],"latest_release":{"name":"1.0.0","tag":"v1.0.0","published_at":"2026-10-14T12:33:34Z","body":"Lines break where the browser breaks them in many more cases: in Chrome, Safari and Firefox, Pretext now finds where lines can break with a port of that browser's own line breaker and its data, in place of its own rules, and rich inline lays its items out as one paragraph, as a browser lays out a paragraph's spans.\n\nAgainst 0.0.9, `layout()` at a new width is three to six times as fast and `prepare()` of text it has measured before 1.1 to 13 times as fast, while loading the library takes about 0.4 ms more on each page in Chrome, 0.7 ms in Safari and 1.1 ms in Firefox.\n\nBundles are larger: the main entry is about 40 KB gzipped, up from 16 KB, and `@chenglou/pretext/rich-inline` about 44 KB, up from 16 KB.\n\nAn app on 0.0.9 has to change every call of `layoutNextLine()` and `layoutNextLineRange()`, which now take the width before the cursor: swap the second and third arguments. It also has to change where it reads rich-inline cursors as places in an item's text (read a fragment's `sourceStart` and `sourceEnd` instead), where it reads `segLevels`, which is gone, or any field of a `prepareWithSegments()` handle other than `segments`, `kinds` and `widths`, where it passes a `font` string that Canvas ignores, such as an empty one, which now throws a `RangeError`, and where it keeps handles made by 0.0.9: prepare the text again.\n\n[CHANGELOG.md](https://github.com/chenglou/pretext/blob/v1.0.0/CHANGELOG.md) has every change and, where something went, what to do instead.\n"},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-10T09:35:25Z","history_start":"2026-09-06"}