Open Bug 1188579 Opened 10 years ago Updated 3 years ago

font size over 1000px is rendered as it is 1000px

Categories

(Core :: Layout: Text and Fonts, defect)

39 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: pavel.kakolin, Unassigned)

Details

Attachments

(2 files)

Attached file test.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36 Steps to reproduce: Set font size to be equal to any value over 1000px. Actual results: Text is rendered as it would render if font size is 1000px. Expected results: Correct font size value should be applied. That works as expected in Chrome and Safari both with system fonts and external fonts.
That is also reproducible with firefox 26.
This is by design; there's code (see gfxFontStyle::GetAdjustedSize) that limits the font-size to 2000, but that's in device pixels, so if you're on a retina-display Mac it will equate to 1000px. This was originally done, I believe, because some systems struggle with exceedingly large font sizes; see e.g bug 383473 and bug 348462. However, it may be that we could safely increase this limit by some reasonable amount; it's possible modern font/graphics backends may be more robust than they were several years ago.
Is there a setting in about:config that user can change for the maximum allowed font size? For my application it's important that users with large displays can use huge fonts. In the application, the number of characters at such a size is very limited, so I assume crashes are unlikely.

(In reply to Koos from comment #4)

Is there a setting in about:config that user can change for the maximum allowed font size?

Flags: needinfo?(jfkthame)

No, it's simply a compile-time constant.

Huge fonts were apparently a problem for freetype, at least, a decade or more ago. But maybe we could safely remove this limit now, or at least make it substantially larger... Mats, WDYT?

Flags: needinfo?(jfkthame) → needinfo?(mats)

This bug is still an issue. I discovered an additional problem with it: any properties defined with font-size-dependent units that are based on, say font-size: 2000px inherit that as one would expect (e.g. margin-top: 1em). As a result, such properties become comically large compared to the text.

Mats, I don't know you, but I believe Jonathan would appreciate your input.

Well, it crashed the X server so I doubt that problem has been fixed tbh...
And we set the constant the largest constant we could make it and still avoid that bug.
Perhaps we can make it #ifdef MOZ_WIDGET_GTK for now though, and make it substantially larger on other platforms?

Flags: needinfo?(mats)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: