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 1M AI News, Cheng Lou, a Midjourney engineer and the author of the React animation library react-motion, has open-sourced Pretext, a pure JavaScript/TypeScript text measurement and layout library with zero dependencies. Pretext bypasses browser DOM measurements (such as getBoundingClientRect and offsetHeight), avoiding layout reflow by calculating text height and line breaks using pure arithmetic. Pretext operates in two phases: prepare() measures character widths in one go using the Canvas API, while layout() performs pure arithmetic calculations based on cached width data. In a benchmark test with 500 text segments, prepare() took about 19ms, while layout() only required 0.09ms. Cheng Lou noted in a supporting article, “The performance improvement is not incremental, but a qualitative change: 0.05ms compared to 30ms, zero reflows compared to five hundred.” The library supports all languages including Chinese, Japanese, Korean, and Arabic, as well as emojis and mixed-direction text, and can render to DOM, Canvas, and SVG. Typical application scenarios include: 1. Virtual lists and occlusion culling without height guessing 2. JavaScript-driven custom layouts like masonry layouts 3. Chat bubbles with multi-line text that adaptively shrink in width 4. Text wrapping around images in editorial layouts.