Futures
Access hundreds of perpetual contracts
TradFi
Gold
One platform for global traditional assets
Options
Hot
Trade European-style vanilla options
Unified Account
Maximize your capital efficiency
Demo Trading
Introduction to Futures Trading
Learn the basics of futures trading
Futures Events
Join events to earn rewards
Demo Trading
Use virtual funds to practice risk-free trading
Launch
CandyDrop
Collect candies to earn airdrops
Launchpool
Quick staking, earn potential new tokens
HODLer Airdrop
Hold GT and get massive airdrops for free
Launchpad
Be early to the next big token project
Alpha Points
Trade on-chain assets and earn airdrops
Futures Points
Earn futures points and claim airdrop rewards
"The future of text layout is not CSS": Midjourney engineer open-sources Pretext
According to monitoring by 1M AI News, Cheng Lou, an engineer at Midjourney and the author of the React animation library react-motion, has open-sourced Pretext, a pure JavaScript/TypeScript text measurement and typography library with zero dependencies. Pretext bypasses browser DOM measurements (like getBoundingClientRect and offsetHeight) to avoid layout reflow, performing text height calculations and line breaks purely through arithmetic.
Pretext operates in two stages: prepare() measures character widths all at once using the Canvas API, while layout() performs pure arithmetic operations based on the cached width data. In a benchmark test with 500 segments of text, prepare() took about 19ms, and layout() only took 0.09ms. Cheng Lou wrote in a supporting article, “The performance improvement is not incremental but transformative: 0.05ms compared to 30ms, zero reflows compared to five hundred.”
The library supports all languages, including Chinese, Japanese, Korean, Arabic, as well as emojis and mixed-direction text, and can render to DOM, Canvas, and SVG. Typical application scenarios include: