W3C home > Mailing lists > Public > www-international@w3.org > January to March 2015

Re: [css-inline] i18n-ISSUE-408: Boxed characters and initial letter properties

From: Dave Cramer <dauwhe@gmail.com>
Date: Fri, 23 Jan 2015 09:39:29 -0500
Message-ID: <CADxXqOwODkSye6OB3Mkq6xG56Pc5ccnHKMeYtXxfsRohiL5aZg@mail.gmail.com>
To: Florian Rivoal <florian@rivoal.net>
Cc: Richard Ishida <ishida@w3.org>, "www-style@w3.org" <www-style@w3.org>, www International <www-international@w3.org>, John Hudson <tiro@tiro.com>
On Fri, Jan 23, 2015 at 9:21 AM, Florian Rivoal <florian@rivoal.net> wrote:

>
> To be able to achieve the full effect of your examples, we would also need to be able to apply borders and padding inwards. Currently, http://dev.w3.org/csswg/css-inline/#initial-letter-box only defines a classical model for padding, border and margin (growing outwards from the content-box, which is the one that gets sized).
>
> The devanagari examples should probably be possible to style with something like this:
> ::first-letter {
>   initial-letter: 3;
>   box-sizing: border-box;
>   border:solid black;
>   padding: 5px; /* Maybe */
> }
>
> Which means we need to define the model for when initial-letter and box-sizing are applied together. How about this:
>
> When box-sizing is not content-box, the outer size of the box designated by box-sizing is sized according to the initial-letter property, and aligned with the surrounding text based on initial-letter-align. The content-box's size is calculated from it after subtracting paddings and borders as appropriate, and the glyph is sized to just fit this content-box vertically - or horizontally in a vertical writing mode, which incidentally also centers it.
>
> If you look at the boxes in the Hebrew and Korean and Devanagari examples you posted, it seems that something close to that, rather than initial-letter-align center, is what is happening: the background color is properly aligned on the relevant aspect of the surrounding script, implying initial-letter-align is still doing its job to place that box, but then the letter inside it is padded inwards, and in the case of Devanagari a border is also applied.
>
> The Chinese example looks tricky: the top of the 大 character is aligned with the top of the characters on the first line, and the box to which the is applied background extends above; on the lower side though, the box to which the background is applied lines up with the bottom of the characters on the last line, and the bottom of the 大 character aligns with nothing in particular. I am not quite sure what to make of that, both in terms of alignment or sizing.


John Hudson posted the following to the Indic List [1]. Seems very
much on topic.


On January 16, 2015 at 5:42 PM, John Hudson <john@tiro.ca> wrote:
> Dave, this is a more general comment about drop caps or similar initial
> letters, not specific to Indic.
>
> There are a variety of styles of drop letters employed in European
> typography, historically speaking, and today I've been thinking through a
> way to address them all within a single architecture. Several of these drop
> cap styles are displayed in Bringhurst's _The Elements of Typographic Style_
> (p.64 in v2.5 of the book); to these I would add the occasional convention
> of a somewhat smaller drop cap floating in the middle of a larger square
> defined relative to the line height, and the use of decorative caps, either
> square or with their own proportions.
>
> It seems to me that all the cases can be described in terms of a field and
> the relationship of one or more glyphs to that field in terms of size and
> position. I wonder if it would be possible to capture this in CSS, such that
> a default behaviour could be defined based upon line distance and font
> metrics, but also enabling custom overrides, such that an author could
> manipulate the dimensions of the field and also the scaling and positioning
> of the glyph within it?
>
> [This would, obviously, be most relevant in the context of webfonts, where
> the glyphs to be displayed can be properly previewed during authoring. I
> presume it might also be possible to define different initial letter
> overrides to different fonts in a fallback sequence, and in the last case to
> fallback on default behaviour. In general terms, the use of webfonts moves
> web typography closer to that of traditional type specification for print,
> where knowledge of the characteristics and behaviour of particular fonts
> enables more precise control of their use. If CSS can provide this level of
> control, while also supporting sensible defaults, this would enable both
> refined typography for more or less static content with predictable display,
> while ensuring good or better handling of arbitrary text in situations where
> the typographic display is not subject to such fine control.]
>
> In the context of Indic scripts, where the overall height of a particular
> graphical cluster cannot be determined from any font metrics, due to
> vertical offsets of mark positioning or consonant stacking, I think being
> able to control the size of drop letters/clusters and their field
> independently would provide authors with necessary control to avoid
> overlaps, clashes, clipping or other tragedies.
>
> JH

So this approach of having an exclusion area defined by initial-letter
and then positioning the letter by various means seems promising.

Dave

[1] https://lists.w3.org/Archives/Public/public-i18n-indic/2015JanMar/0007.html
Received on Friday, 23 January 2015 14:40:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 21 September 2016 22:37:38 UTC