Skip to content

fix: no text auto-sizing on webkit#1186

Merged
alecthomas merged 1 commit intoalecthomas:masterfrom
jacqueminv:jacqueminv/1101-fix-ios-text-auto-sizing
Jan 3, 2026
Merged

fix: no text auto-sizing on webkit#1186
alecthomas merged 1 commit intoalecthomas:masterfrom
jacqueminv:jacqueminv/1101-fix-ios-text-auto-sizing

Conversation

@jacqueminv
Copy link
Copy Markdown
Contributor

@jacqueminv jacqueminv commented Dec 30, 2025

That ensures that no line is displayed with a bigger font-size due to its length.

see https://bugs.webkit.org/show_bug.cgi?id=304640

Fixes #1101

@alecthomas
Copy link
Copy Markdown
Owner

Did you check this actually fixes it?

@jacqueminv
Copy link
Copy Markdown
Contributor Author

I've run the following test from master branch today (commit 2e611c1):

package chroma

import (
	"testing"
	"os"
	"github.com/alecthomas/chroma/v2/quick"
)

func TestMain(t *testing.T) {
	quick.Highlight(os.Stdout, `jq -c '[ .[] | {title: .media[0].title, date: first(.media[].creation_timestamp), pictures: .media | del(.[].creation_timestamp, .[].title, .[].media_metadata, .[].cross_post_source), location: first(.media[].media_metadata?.photo_metadata?.exif_data[0]?)} ]' posts_1.json > preprocess.json

echo "shorter line"`, "sh", "html", "monokai")
}

I edited the html output to add a meta element to default the width to the device-width.

Results

Here are the results, I've executed the same test once without the bugfix from this PR and once with the bugfix.

Without the bugfix from this PR

Image

With the bugfix

Image

That ensures that no line is displayed with a bigger font-size due to
its length.

see https://bugs.webkit.org/show_bug.cgi?id=304640

FIX 1101
@alecthomas alecthomas merged commit 31592d5 into alecthomas:master Jan 3, 2026
2 checks passed
@alecthomas
Copy link
Copy Markdown
Owner

Thanks!

@jacqueminv
Copy link
Copy Markdown
Contributor Author

My pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fonts look weird in Safari (IOS)

2 participants