Closed Bug 163376 Opened 23 years ago Closed 21 years ago

::first-letter initial caps poorly adjusted to flow

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

RESOLVED DUPLICATE of bug 21616
Future

People

(Reporter: nikd, Unassigned)

Details

(Keywords: css3, testcase)

Attachments

(3 files)

When making initial caps in CSS, one shouldn't have to adjust margins to make the initial cap fit nicely in the flow. With the definition p.cap:first-letter { float: left; position: relative; font-weight: 700; font-size: 400% } one expects an intial cap that is rendered with respect to the font metrics defined for the selected font. In reality, it seems that metrics for the Helvetica or Times fonts are used whatever font is selected (as these look the least distorted). Adding margin: -0.1em 0.1em -0.2em 0em; to the definition somewhat relieves the problem for most fonts, but it shouldn't be necessary, and it also complicates matters (IE renders things differently, of course). The test case at http://homepage.mac.com/nikd/caps/ has ten different style sheets with ten different fonts. Use the "Use Style" list in the View menu to see how various fonts are rendered with or without adjusted margins. It may not be possible to implement the perfect initial cap algorithm within the CSS scope, but the initial cap should have ample room to the text on the right (there is overlap using Georgia and American Typewriter, and in general it is too close). The initial cap should also not be pushed down too much.
Attached image Example 1 (from URL)
Red = unadjusted, blue = adjusted
Attached image Example 2 (from URL)
Another example. Note the overlap.
CSS3 (text module?) might have some things that will allow this to be better.
Assignee: dbaron → attinasi
Status: UNCONFIRMED → NEW
Component: Style System → Layout
Ever confirmed: true
Keywords: css3
OS: MacOS X → All
QA Contact: ian → petersen
Hardware: Macintosh → All
QA Contact: petersen → amar
Priority: -- → P4
Target Milestone: --- → Future
If you set different background colors, it looks like gratuitous top and bottom padding is added to the initial letter. Explicitly setting the padding to zero has no effect. (Explicitly setting the line-height also has no effect, but this may be correct behavior for a floated letter--the spec isn't quite clear on this point.)
.
Assignee: attinasi → other
Priority: P4 → --
QA Contact: amar → ian
Target Milestone: Future → ---
Priority: -- → P4
Target Milestone: --- → Future
Keywords: testcase
Summary: :first-letter initial caps poorly adjusted to flow → ::first-letter initial caps poorly adjusted to flow
*** This bug has been marked as a duplicate of 21616 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: