PandaText / Guides

Text layout guides

Why the same string wraps differently on iOS, Android and in the browser, and what has to be shared if a document should not.

The same sentence on an iPhone and an Android phone. The iPhone ends the first line with “The”; Android ends it after “it.”.

Why the same text wraps differently on iOS and Android

One sentence on an iPhone and an Android phone, same size and width. The system font, emoji and line height each changed the result.

The same note on an iPhone and an Android phone. The link breaks after “https://” on the iPhone and after “https://docs” on Android.

How to keep the same line breaks on iOS, Android and the web

One note with one font file broke four ways on iPhone, Android, Chrome, Safari and Firefox. What a shared engine has to own to fix that.

The same paragraph in Chrome and Safari. Chrome's second line ends with “open”; Safari's ends with “when”.

Why the same paragraph wraps differently in Chrome, Safari and Firefox

The same text in Chrome, Safari and Firefox on one Mac. text-wrap: pretty, emoji and long URLs each produced different line breaks.

The same letter-spaced Arabic line. The iPhone pulls the letters apart and wraps it onto two lines; Android keeps one line.

How Arabic and English share one line

Arabic and English on one line, on iPhone, Android, Chrome, Safari and Firefox. Same order and breaks, but different fonts, heights and spacing.

The same Japanese paragraph on an iPhone and in Safari. Safari keeps “た。” on the first line; the iPhone moves it to the second.

Why Chinese and Japanese text breaks differently on each platform

One Japanese paragraph broke three ways on iPhone, Android, Chrome, Safari and Firefox. Width, line fit and the language tag make the difference.

In Chrome, the green bar shows the width of the text on the page and the longer red bar the width Canvas measureText() reports, 40 px wider.

How to measure text the same way on every platform

Canvas measureText() was off from the page by up to 50 px in Chrome and Firefox. Why one engine should return the width, line breaks and carets.