Repository navigation
Update frontend dependencies (dev) (major) - #377
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
from
August 26, 2026 17:57
e261de3 to
13f3087
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
5 times, most recently
from
September 8, 2026 12:14
3042778 to
37ffb10
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
5 times, most recently
from
September 16, 2026 20:58
dd44cdd to
6213e51
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
4 times, most recently
from
September 24, 2026 10:48
74a1559 to
782e279
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
4 times, most recently
from
October 1, 2026 15:23
b6b1299 to
c354dff
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
6 times, most recently
from
October 8, 2026 12:10
70f41ec to
66002aa
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
from
October 9, 2026 14:09
66002aa to
dbba392
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
5 times, most recently
from
October 17, 2026 00:54
0efc489 to
257e6ff
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
from
October 20, 2026 16:07
257e6ff to
8b05163
Compare
renovate
Bot
force-pushed
the
renovate/dev-major-frontend-dependencies
branch
from
October 21, 2026 15:30
8b05163 to
ba9dff1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
^0.0.9→^1.0.0^8.21.3→^9.0.0^12.43.0→^14.0.0^10.1.0→^11.0.0~6.0.3→~7.0.0^4.1.11→^5.0.0Release Notes
chenglou/pretext (@chenglou/pretext)
v1.0.0Compare Source
Upgrading from 0.0.9
layoutNextLine()andlayoutNextLineRange()take the width before the cursor,(prepared, maxWidth, start?), aslayoutNextRichInlineLineRange()does, and give the first line without a cursor: swap the second and third arguments at every call. TypeScript reports each call left in the old order; in JavaScript, search for the two names, since a call left in the old order never returnsnull(#496).endand a fragment range'sstartandendno longer index the item's own text, and a materialized fragment's type no longer hasstartandend, so code that read them there no longer compiles. Read itssourceStartandsourceEndinstead, and keep the range of a line you pass back (#460, #483).prepareWithSegments()handle shows onlysegments,kindsandwidths, all read-only: copy one before passing it on as an array or calling array methods onwidths(prepared.segments.slice(),Array.from(prepared.widths)), callmeasureNaturalWidth()for a text's width, and read a line'swidthfor a line's (#450).segLevelsis gone: paint each paragraph of mixed-direction text as one DOM element with its direction set (#258).kinds,'glue'is gone, a run of no-break spaces being'text', and'zero-width-glue'and'control'are new (#240, #340).setLocale(locale)now sets the language text is laid out under, in place of<html lang>: pass the page's language, not the user's, or drop the call.setLocale()with no argument goes back to<html lang>, andsetLocale('')no longer does (#340, #356).letterSpacingthat isn't finite now throws aRangeErrorwhen preparing (#356).fontstring that Canvas ignores, such as'','16px'or'Arial 16px', now throws aRangeErrorwhen preparing: check whatgetComputedStyle(el).fontgave before passing it on (#502).break: 'never'item in the text beside it: the item's own leading and trailing white space no longer makes a gap, and an item of only white space is an empty box as wide as itsextraWidth. An item of only a zero-width space or soft hyphens, such as an editor's placeholder, gets no fragment on a line whose start consumes it, as after a space that ends the line before (#369, #460).prepareRichInline()'s list may be a box, so check itstextbefore reading its font; a run type of your own can't carry awidth; a fragment range built by hand needsgapItemIndex, and a materialized fragmentsourceStartandsourceEndtoo, and nostartorend; andparagraphs.map(prepareRichInline)needs an arrow function,items => prepareRichInline(items)(#310, #379, #387, #460, #483).Added
{ width }(RichInlineBox), for an image, a custom emoji, a formula or a badge inside a line, in place of a character withbreak: 'never'and anextraWidththat made up the rest of the object's width. A line can break before and after a box, as at an<img>, whatever text touches it, and its fragment has the box's width and no text. Heights stay yours: give each boxvertical-align: top, and each line is as tall as the paragraph's line height or its tallest box, whichever is taller.prepareRichInline()now takesArray<RichInlineItem | RichInlineBox>, so code typed from its parameter checks an item'stextbefore reading its text or font, andRichInlineItemhaswidth?: never, so an app whose own run type carries awidthbeside itstextno longer type-checks atprepareRichInline(): pass such runs without that field, or name it otherwise; at run time such an item still lays out as text (#387).prepareRichInline()takes an options argument,{ whiteSpace: 'pre-wrap' }, for CSSwhite-space: pre-wrapon the paragraph, asprepare()does: every item but an atomic one keeps its spaces, tabs and newlines, spaces at a line's end hang past it across a change of style, tab stops count from the line's start, and a newline ends its line, so an editor's paragraph split into styled runs takes the lines the browser gives it. White space after an atomic item wider than the line stays on that item's line, whatever items it spans; in Firefox, such white space that runs into a tab moves to the next line with the tab. A tab counts its stops in its own item's font, as Safari does; Chrome and Firefox count them in the paragraph's font, so a tab inside a span in another font, such as a code span, can land a whole stop from theirs.paragraphs.map(prepareRichInline)no longer type-checks, sincemap()hands its index where the options go: writeitems => prepareRichInline(items)(#381, #386, #395, #419, #460).prepareRichInline()'s options argument also takes{ wordBreak: 'keep-all' }, for CSSword-break: keep-allon the paragraph, asprepare()does, so Korean, Chinese and Japanese messages with mentions, bold runs or code spans break where the browser breaks them under keep-all (#379).gapItemIndex, the index of the item whose collapsed spacegapBeforemeasures, or -1 when no space precedes the fragment on its line. A painter can draw that space inside the element of the item whose font measured it, and can tell a space that takes no room apart from no space (#310).sourceStartandsourceEnd, where the fragment's text sits in its item'stext, as UTF-16 offsets: of the itemsShipandit now, the fragmentit nowis 1 to 7. Read them where code written for 0.0.9 read the fragment'sstartandendas cursors into the item's own text, which they no longer are (under Changed). TypeScript that builds a fragment by hand, as a test does, now has to give it these two andgapItemIndex, and to leave outstartandend, which a materialized fragment's type no longer has; a fragment range built by hand needsgapItemIndex(#460, #483).walkLineRanges(),measureLineStats(),measureNaturalWidth()andlayoutNextLineRange()now also take aprepare()handle, so an app that only needs line counts, widths or cursors, such as a chat bubble shrunk to its widest line, no longer has to keep every segment's string in memory withprepareWithSegments().layoutWithLines(),layoutNextLine()andmaterializeLineRange(), which return text, still needprepareWithSegments()(#449).Changed
@chenglou/pretext/rich-inlineabout 44 KB (107 KB), up from 16 KB (49 KB). About 23 KB gzipped of each is each browser's line-break and grapheme data with the code that reads it, which replace Pretext's own break rules and the Unicode bidi-class table that 0.0.9 bundled forsegLevels. The npm package is 56 files and about 1,030 KB unpacked, where 0.0.9 was 69 files and 887 KB, 534 KB of it the demos, which have left the package (#258, #311, #340, #342, #344, #392, #394, #403, #460, #515).layout()at a new width is three to six times as fast.measureLineStats()andwalkLineRanges()are 1.8 to 4.9 times as fast,layoutWithLines()1.3 to 1.7 times andlayoutNextLineRange()1.1 to 2.2 times.prepare()of text it has measured before, as when a list prepares its messages again, is 1.1 to 13 times as fast: two to three and a half times for English text, 6 to 13 times for Chinese and Japanese, least for Thai. Text it hasn't measured before is about 1.5 to 2.1 times as fast for English, Chinese and Japanese, 1.1 to 1.6 times for messages that mix scripts, and from level to 1.7 times for Arabic and Thai. Rich inline, timed on the Markdown chat demo's paragraphs (English, most of them one item), prepares and measures new ones about 1.4 to 1.9 times as fast and ones it has measured before 2.3 to 4.8 times as fast.measureRichInlineStats()is two to three times as fast there, andwalkRichInlineLineRanges()andlayoutNextRichInlineLineRange()1.1 to 1.9 times, least on paragraphs of several styled items. Worst-case text, such as letter-spaced CJK, soft hyphens among combining marks, long unbroken runs andpre-wraptext, is faster too, inprepare()and inlayout().clearCache()takes 9% to 15% longer, since Pretext now asks Canvas how many glyphs Safari spaces (#513, under Fixed). The firstprepare()of interface labels is slower in some languages, most of them with long words, though labels of 35 languages mixed are level or faster in the three browsers. Most of that cost is the widths a word 80px or wider now gets for each of its letters when it is first prepared, for a line narrower than the word, which cuts it between letters.pre-wraptext, tab stops now follow each browser. Chrome and Firefox count letter spacing in every stop, so a run of tabs under negativeletterSpacingno longer collapses to one stop's width. A tab closer to its stop than the browser's minimum, half a space in Chrome and Safari and half a0in Firefox, takes the stop after it. In Firefox, which doesn't hang tabs, a word whose tab doesn't fit moves to the next line with the tab, so tab-separated text such as a pasted table or indented code wraps where Firefox wraps it (#240, #395).break: 'never') own leading or trailing white space no longer gives a gap before or after it, as browsers trim that white space inside the item's box: where only that white space stood,gapBeforeis now 0, andgapItemIndex-1, where 0.0.9 measured a space in the atomic item's font. An atomic item of only white space is an empty box as wide as itsextraWidth, as browsers lay out an inline-block that holds only white space, where 0.0.9 made it a collapsed space with noextraWidth(#369, #460).Intl.Segmenter, which it needs only for text in Thai, Lao, Khmer, Myanmar and the other Southeast Asian scripts written without spaces (#344).؟,؛or۔before a following word, after a?that follows a space or a zero-width space, and after!or?before a symbol such as©,¿or€. In Chrome and Safari they can also break after?before$,%,+,|or-, while!still stays with those and with a following ASCII letter or digit; in Firefox they can break after!before a letter or digit, and!and?stay with a following-or|.-does so only before a letter outside ASCII in Chrome, such asé, and outside Latin-1 in Safari. In Firefox, a hyphen stays with a number after it, as in2025-08-01orlog-2026, and a line can break after/before a letter, as inand/ororexample.com/docs, though not before a number, as in1/2.。,,,」,、,]or゛: such a mark stays with the text before it, CJK or not, as inxxxx,or😀。, and after CJK text so do',/,|,‼and%. A word that doesn't fit a line with its mark breaks before the mark..,,,:,;,),],%or"keeps a following word or number on its line, and!,},/or|keeps what each browser keeps: Chrome ASCII letters and digits; Safari digits, and letters only after a}that follows an ideograph or Hangul syllable; Firefox only digits after/. A time or number before closing punctuation such as a full-width comma, as in00:00:00,, stays whole.」or)and a following ideograph, kana or Hangul syllable.ーafter CJK text can start a line in Chrome, in Safari only on pages whose<html lang>is Japanese or Korean, and not in Firefox; where they can't, they also stay with a letter or digit before them, as in約3ヶ月.word-break: keep-all, lines in Chrome and Firefox no longer break afterーin words such asラーメン, nor in Chrome after an iteration mark such as々. In Chrome and Firefox they can break before an opening bracket after CJK text, as in서울(한국)에서, before「or(after Latin letters or digits, and next to Thai text; in Chrome also next to emoji and symbols such as★, and before an opening quotation mark or after a closing one between CJK characters, as in他说“你好”然后; in Firefox also after a flag emoji.漢。or「漢, breaks between characters when it doesn't fit a line, instead of overflowing, and a run of opening brackets stays with the word after it, as in「「tail.,or)at the start of an item stays with the word before it, and a word split across items wraps as one word, moving to the next line whole where it doesn't fit. Items without a space between them still break where the joined text allows it, such as between CJK characters, at Thai word boundaries or after-. In Chrome and Firefox, where items split a word, as when part of a Thai or Myanmar word is styled, lines end at that word's own breaks. In Safari, breaks inside each item still come from that item's own text, as Safari wraps each span, so a Thai, Lao, Khmer or Myanmar word split across items wraps like Safari's spans.gapItemIndex; an item that starts with a soft hyphen and a space keeps that space after other text on the line. White space between the soft hyphens of such an item takes room after other text in Chrome and Safari, as in one element, and a line too narrow for anything ends at its first soft hyphen. An item of only soft hyphens or a zero-width space gets no fragment on a line whose start consumes it, where 0.0.9 gave it one that took no room.endand a fragment'sstartandendnow count segments of the item's part of the paragraph, and are only for passing back tolayoutNextRichInlineLineRange()andmaterializeRichInlineLineRange(). On 0.0.9 they indexed the item's own prepared text,prepareWithSegments(item.text), and they no longer do: they differ, among others, for an item that starts with white space after another item's text, whose first segment is now that space; for an atomic item, which is one segment; for an item that starts inside a word whose breaks depend on the whole word, as a Thai word's do in Chrome and Firefox; and for an item withextraWidththat starts with a zero-width space, whose start is now a segment of its own before that space. A paragraph of one text item that isn't atomic and has noextraWidthkeeps that text's own cursors. To find a fragment's text in its item, read the materialized fragment'ssourceStartandsourceEnd(under Added): its type no longer hasstartandend, so TypeScript that reads them there no longer type-checks. Nor does a materialized line or fragment where a range is asked, as when a line is passed back tomaterializeRichInlineLineRange(): keep the range of a line you pass back.extraWidththat holds only a zero-width space, such as an empty code span kept open with one, stays on a line where only half itsextraWidth, the end padding, doesn't fit, so that line'swidthis more thanmaxWidth; 0.0.9 moved it to the next line, which is where those browsers put it after a space. In Firefox, a line that ends at a space before a soft hyphen in another item reports that space in its width, one space wider than Firefox paints. Also in Firefox, where an item ends with a space and the next starts with a bidi control, such as U+200E, and another space, a one-word line that ends at the first space reports that space in its width as well, and a longer line that fits only without that space now gives up its last word to the next line, which Firefox does in some such paragraphs and not in others, so the paragraph can come out a line taller than Firefox's.prepareWithSegments()handle'skindschanged.'glue'is gone: a segment of no-break spaces or a word joiner is now'text', so code that compares a kind with'glue'no longer type-checks. Two are new:'zero-width-glue', a zero-width space or soft hyphen the browser doesn't break after, as before a combining mark, and'control', in Safari a next-line character (U+0085) (#240, #340).prepareWithSegments()handle now shows three read-only fields and nothing else:segments,kindsandwidths, each segment's width in px. The eleven others that 0.0.9's type showed are the library's own working data for laying out lines, which changes with engine fixes: six are gone (under Removed), and reading any of the rest no longer type-checks. For a text's width, callmeasureNaturalWidth(); for a line's, read the line'swidth. Each letter's width (breakableFitAdvances) and the hyphen's (discretionaryHyphenWidth) have no public equivalent. All three are read-only: to pass one on as astring[]ornumber[], or to write to it, copy it first, withprepared.segments.slice()orArray.from(prepared.widths).widthsis typedArrayLike<number>, with an index and alength, sofor...of, spread andreduce()on it need that copy too (#450).TypeErrorin this version's line functions, so prepare the text again. A handle also holds a typed array now, so a deep freeze of one throws; one frozen withObject.freeze()alone, or whose objects and arrays a store froze, still lays out and materializes as it did (#340, #460, #494, #509).word-break: keep-all, and at U+2028 and U+2029 (#340).langnow breaks and measures under Chrome's UI language, as Chrome lays it out: under a Chinese UI, curly double quotes follow the line-break rules of CJK brackets, so a line can break before “ and after ”, as in他说“OK”然后, and never right after “ or right before ” (#340).setLocale(locale)now sets the language that laterprepare(),prepareWithSegments()andprepareRichInline()calls break lines and measure under, in place of the page's<html lang>, which a worker doesn't have;setLocale()without a locale goes back to<html lang>, andsetLocale('')is a page without a language, where 0.0.9 took an empty string as no argument. It no longer passes the locale toIntl.Segmenter, whose word boundaries Pretext now reads only inside Thai, Lao, Khmer and Myanmar text, where no locale changes them (#340, #356).prepare(),prepareWithSegments()andprepareRichInline()now throw aRangeErrorfor aletterSpacingthat isn't finite, such asNaNorInfinity, which gave lines of widthNaN, or a line per grapheme (#356).prepare(),prepareWithSegments()andprepareRichInline()now throw aRangeErrorfor afontstring that Canvas ignores, such as'','16px','Arial 16px'(the family first) or'var(--font)'. A Canvas context given such a string keeps the font it had, so 0.0.9 measured the text in whatever font was prepared last, with no error. An empty string is whatgetComputedStyle(el).fontgives for an element that sets a longhand the shorthand can't hold, such asfont-variant-numeric, or that isn't mounted yet. Each browser throws for what its own Canvas ignores: Firefox also for a size that isn't an absolute length, such as1.5emor100%, and Firefox and Safari forcaptionand the other system fonts (#502).prepare(),prepareWithSegments()andprepareRichInline()share no longer grow for as long as the page lives, which they did where text never repeats, as ids, numbers and URLs don't. Once they hold more than 262,144 segments between all fonts, the next preparation empties them before it measures anything, asclearCache()does: prepared handles keep their widths, and text prepared afterwards is measured again. For scale, 880,000 UTF-16 units of mixed-language text in one font fill 27% to 43% of that, by browser (#508).Removed
prepareWithSegments()no longer returnssegLevels. Those approximate bidi levels per segment couldn't produce visual order, and computing them slowed everyprepareWithSegments()and rich-inline preparation, most for Arabic and Hebrew text. To draw mixed bidi text, render each paragraph as one DOM element with its direction set, and the browser orders every line. Lines drawn separately, such as with CanvasfillText(), are each ordered as their own paragraph, so numbers or punctuation next to a line break can come out in a different order (#258).prepareWithSegments()handle no longer haslineEndFitAdvances,lineEndPaintAdvances,breakablePreferredBreaks,spacingGraphemeCountsorchunks, fields README never documented but 0.0.9's published type showed; none has a public equivalent (#255, #340).pages/demosandpages/assets). They live in the repository (#342).Fixed
AV, the cut can still fall a letter from Firefox's and the word take a line more or fewer. Firefox also keeps the letters of a ligature, such asfiin fonts that join it or Armenianու, on one line, and moves them to the next together where they don't fit; Pretext can still cut between them in a word of more than 96 letters. The widths for this are measured when such a word is first prepared, the cost new labels in languages with long words pay (under Changed) (#340, #435).break: 'never'item that takes no room, or a box of width 0, that falls past the end of a full line, as after a space that doesn't fit, now lands on the line Firefox puts it on. It stays at the end of the full line where it is the paragraph's last item, where a box or chip with a width follows it, or text withoutextraWidththat starts with a space, and inpre-wrapafter spaces that hang. It starts the next line where text or an item withextraWidthfollows it directly, or where the white space before it follows text already wider than the line. It used to start the next line in every case, which could give the paragraph a line more than Firefox lays out and put the item's fragment, and the height an app gives each line from its boxes, on the wrong line (#387, #405).A,TorY, and in some fonts the space after many words, which Chrome's Canvas doesn't report for words measured apart, so a line with several such words was up to a few pixels too wide: a paragraph of card-length text took a line more than Chrome gave it at about one width in 600 in Arial, and one in 75 in Gill Sans, and a bubble sized to its widest line was that much too wide. Pretext now reads that kerning from Canvas: the first text with a space in a font costs two moremeasureTextcalls, which tell whether the font kerns the space, and only a font that does costs more, up to three calls for each distinct first or last character of its words other than ideographs, kana and Hangul syllables, so the first paragraphs in such a font make the most extra calls and later ones next to none. Where a line ends at a word that kerns with the space after it, the word is measured without that kerning, as Chrome lays it out in centered, right-aligned, justified or underlined text and in text directly inside an element with a background; in plain start-aligned text Chrome keeps the kerning there, so such a line can still wrap one word sooner than Chrome, as before, and never later. A font that kerns only characters outside ASCII against the space, as Tamil MN and Malayalam MN do, and text that holds right-to-left letters or a bidi control other than LRM, measure as before. In rich inline, a collapsed space at an item's start or end is measured with that item's text beside it, sogapBeforeand the line's width hold this kerning too:Aand a space in 16px Arial are 0.88px narrower (#408, #423, #426, #460).layout()said. Under a font list of one family that Chrome's Canvas doesn't shape as a whole, such as"Helvetica Neue"alone, kana that the system's fallback font draws still measure apart: name a Japanese font after it (#497).whiteSpace: 'normal'now takes no room, as Firefox draws it, inside a rich-inline item and at its start or end too:ab\rcdis as wide asabcd, and a line can still end afterab. Before, it took the room of a space.\r\nis still one space. White space that starts the next rich-inline item after one is measured in that item's own font and letter spacing, as Firefox draws it, where the item that held the carriage return or form feed measured it (#399, #460).whiteSpace: 'normal'now takes no room, as Safari draws it, inside a rich-inline item and at its start or end too:ab\rcdis as wide asabcd, and no line ends at the carriage return in text that is all Latin-1; where the text holds characters outside it, such as Cyrillic, Arabic or Chinese letters, a line can end after the carriage return where Safari ends one, as inбв\rcdand not inбв\r12. On 0.0.9 it took the room of a space and a line could end at it, so a line holding one measured a space too wide and a paragraph could come out a line taller than Safari's.\r\nis still one space, and white space that starts the next rich-inline item after a carriage return is measured in that item's own font and letter spacing. One kind of font goes the other way: where the first installed family of a font list ismonospaceor one of macOS's own fixed-pitch fonts, Menlo, Monaco, Courier, Andale Mono or PT Mono, Safari gives the carriage return a character's width. For one carriage return between two letters the space 0.0.9 gave it was as wide; now a line holding one measures a character too narrow in those fonts, and a paragraph can come out a line shorter than Safari's. Courier New,ui-monospaceand web fonts aren't among them (#455, #460).ab, space, soft hyphen, space,cd, now take the room of one space, as Firefox collapses them into one, instead of two (#399).⚡in Menlo,⬜in Inter or⚪in Hiragino Sans, or one before the text-presentation selector U+FE0E. A pictograph written with no U+FE0F after it that the system's emoji font draws all the same, such as U+1F336🌶or U+1F5D1🗑in Arial, and an emoji sequence that the emoji font has no glyph for, and draws as two emoji, no longer measure 4-5px wider than drawn (#398).letterSpacingno longer adds space after the letters of Arabic, Persian, Urdu and the other joined scripts (Syriac, N'Ko, Mandaic, Mongolian, Phags-pa, Hanifi Rohingya), as the browsers add none: Chrome, which also leaves out the digits, brackets and punctuation inside such text and spaces only its spaces, and Firefox, which keeps spacing those. Such text measured too wide by the spacing times its letters, or too narrow under negative spacing, so its lines broke elsewhere than the browser's. Safari spaces each glyph it draws, and so does Pretext there now (below). This is Chrome's rule since 149. Chrome 138 to 148 leave those spaces unspaced too, and Chromium before 138 spaces every letter, as Pretext did; on those, as in an older Electron app or WebView, Pretext's width for such text is now off by the spacing times its spaces, or times its letters (#397).letterSpacingnow counts as Firefox lays it out, in whole steps of 1/60px: at -0.08px each character takes -5/60px, and a spacing under 1/120px none. A spacing between steps, such as -0.08px or one computed from an em value, made each line a little wider or narrower than Firefox's, 0.1px over 30 characters at -0.08px, so a word could land on another line (#397).letterSpacingin a font withfi,florffiligatures, such as Roboto, Futura, Hoefler Text or Iowan Old Style, now measures as wide as the browser draws it. Browsers turn those ligatures off under any letter spacing, and Pretext measured the words with them, up to 1.3px too narrow per word at 16px, so a line could hold a word the browser wraps and an element sized to the widest line could wrap again. Safari's Canvas can't measure such text without its ligatures, so there the widths stay that much too narrow (#397).letterSpacingnow adds its space after each glyph Safari draws, as Safari does, in text it shapes as complex text, such as Hindi and the other Indic scripts, Thai, Khmer and Arabic, and a word with a combining accent. Pretext added it after each grapheme, so a Devanagari consonant drawn with its vowel sign as two glyphs measured a spacing too narrow and Arabic's lam-alef, two letters drawn as one glyph, a spacing too wide: a line could hold a word Safari wraps, and a paragraph come out a line shorter than Safari's. Where a font joins two letters of such text into an optional ligature, which Safari's page turns off under letter spacing and its Canvas keeps, the pair still measures too narrow, now by a spacing as well: letter-spaced Arabic in Al Nile or Damascus, which join common pairs, breaks elsewhere than Safari's a little more often than it did (16 of 24 paragraph and width pairs tried, where 13 did). Counting the glyphs costs Safari one moremeasureTextcall for each prefix of such a word that is new to its font, about twice the calls of 0.0.9 for letter-spaced Hindi and Arabic paragraphs, the first time they are prepared and each time afterclearCache(). Text withoutletterSpacing, and Chrome and Firefox, measure as before (#513).-of a compound such ascontre-pro\u00ADposition, a dash, or a break between Chinese or Japanese characters, as the browsers lay it out, instead of keeping the hyphen past the line's end; so does a line whose word holds a control character. Text with many soft hyphens, such as hyphenated German, often took other breaks than the browser's, sometimes with a line fewer. WithletterSpacing, Chrome's visible hyphen no longer gets letter spacing of its own (#239, #340, #396, #446, #515).-. Some fonts draw the two differently, such as Inter, whose U+2010 is 1.6px narrower at 16px, and Chinese fonts such as Songti SC, whose U+2010 is a full em wide, so such lines now break where the browser breaks them and report the width it paints. The line'stextstill ends with-(#396).pre-wrapand inside a rich-inline item, where 0.0.9 kept the text after it on the same line. A line holding only soft hyphens or spaces between two separators counts as a line (#340, #349, #369, #381).cd, which CanvasfillText()orwhite-space: prepainted one space to the right. It now starts after the space, as the browsers start that line and aslayoutWithLines()does. At any letter spacing, a rich line's first fragment now starts after the spaces and soft hyphens a line start skips, where itsstartcursor used to sit before them (#380).materializeLineRange()andmaterializeRichInlineLineRange(), given a range that ends past its text, such as one kept from a longer text that was since prepared again, now build the text up to its end. Before, each missing segment addedundefinedto the line's text, and a range ending at segmentInfinityran until memory ran out (#353).white-space: pre-wrap, a line holding only soft hyphens before a newline, at the start of the text or after another newline, now counts as a line, as browsers draw it, instead of disappearing (#349).serif,sans-serif,cursive,fantasyormonospace, or falling back to one of them, now measures in the font Safari draws it with there, such as Apple SD Gothic Neo forsans-serifon akopage and Menlo formonospaceon anenpage, instead of the font those names give a page without a language. WebKit on other systems, such as GNOME Web, a Tauri app on Linux or Playwright's WebKit there, gives those names the same fonts on the page as in Canvas, and Pretext measures them as given there, as 0.0.9 did (#340, #505).text-spacing-trimgives it, also where a rich-inline item boundary splits the pair, such as」ending a bold item before。, whatever the two items' fonts; a closing mark such as」or)takes it before a newline inpre-wrapor before a space too, where nothing earlier on the line can wrap, as at a narrow width (#340, #366, #425, #460).jaandzhpages neither does one next to East Asian punctuation (#340).<html lang>now uses the fonts for the new language, even when the font string is unchanged (#230).letterSpacingand without, so letters such asAin Arial or Times New Roman fit narrow lines as they do natively (#236, #271, #513).letterSpacing(#236).word-break: keep-all. In Safari, text prepared in a web worker now gets the same rules as on the page (#237).white-space: normal, matching the browser (#238).letterSpacingno longer adds space after a next-line character (U+0085), except next to text that Safari shapes as complex text, such as Arabic, Devanagari or a combining mark (#240).layoutWithLines(),walkLineRanges(),layoutNextLine(),layoutNextLineRange()and rich-inline layout. Previously, other content such as a soft hyphen or a word joiner, orletterSpacing, moved it to the start of the next line. Plain-text line counts and widths don't change (#272).maxWidthnow lays out as 0 does inlayout()and the other plain-text line functions. It could give anoConfiguration
📅 Schedule: (in timezone Europe/Warsaw)
* * * * 0,6)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.