Re: fontSize and percentages

On Mon, Aug 19, 2013 at 5:11 AM, Nigel Megitt <nigel.megitt@bbc.co.uk>wrote:

>  Hi Yves,
>
>  The draft text for the next edition of the specification, at
> http://www.w3.org/TR/ttaf1-dfxp/#style-attribute-fontSize includes a note
> that hopefully answers your question, as well as making clear that when
> only one length value is specified it applies equally to horizontal and
> vertical scaling, and is proportional to the cell size when specifed as a
> percentage.
>
>  The answer to your first question is yes, the width is 640/32 * 75% = 15.
>

Actually, this is wrong, since it doesn't preserve EM cell aspect ratio. If
there is one length specification, it applies uniformly to both dimensions,
however, the resolution of a percentage size is in accordance only with the
height of a cell (if resolved related to a cell unit).

So, for example, if the intrinsic size of an EM square is 1px (width) x 1px
(height), then your example would scale this EM square to 24px (width) x
24px (height).

On the other hand, if you specified fontSize="75% 75%", then this would
scale the EM square to 15px (width) x 24px (height).

The relevant spec language is at 8.2.9:

If a single <length><https://dvcs.w3.org/hg/ttml/raw-file/default/ttml10/spec/ttaf1-dfxp.html#style-value-length>
value
is specified, then this length applies equally to horizontal and vertical
scaling of a glyph's EM square; if two
<length><https://dvcs.w3.org/hg/ttml/raw-file/default/ttml10/spec/ttaf1-dfxp.html#style-value-length>
values
are specified, then the first expresses the horizontal scaling and the
second expresses vertical scaling.


>
>  Non-proportional scaling is the expected behaviour to allow font sizes
> that are 2 rows in height and 1 column in width to be denoted.
>
>  Nigel
>
>   ------------------------------
> *From:* Nigel Megitt
> *Sent:* 19 August 2013 12:02
> *To:* De Muyter, Yves (Contractor); public-tt@w3.org
> *Subject:* RE: fontSize and percentages
>
>   ------------------------------
> *From:* De Muyter, Yves (Contractor) [Yves.DeMuyter@eu.sony.com]
> *Sent:* 19 August 2013 08:30
> *To:* public-tt@w3.org
> *Subject:* fontSize and percentages
>
>   Hello,
>
>
>
> I have a question regarding percentages on fontSize and having 1 or 2
> values on the tts:fontSize attribute.
>
>
>
> Given this example (some unneeded attributes are omitted for readability):
>
>
>
> <tt tts:extent="640px 480px" ttp:cellResolution="32 15">
>
> <head>
>
> <layout>
>
>                 <region xml:id="r1" tts:fontFamily="monospace"
>  tts:fontSize="75%">
>
> </layout>
>
> </head>
>
> <body>
>
>                 <div region="r1">
>
>                                 <p>This is text</p>
>
>                 </div>
>
> </body>
>
> </tt>
>
>
>
> It means the height of the fontsize is 480/15 * 75% = 24
>
>
>
> Does it also mean the width of the fontsize is 640/32 * 75% = 15  ?
>
>
>
> Or does it mean we need to use the scaling value of the height and apply
> that equally to the width to have proportional scaling ? The spec doesn¹t
> clearly say that having a single scaling factor means you need to have
> proportional scaling, that¹s why I¹m hesitating right now for this detail.
>
>
>
> Yves De Muyter
>
> Techsoft Centre
>
> Technology and Software Centre Europe (TSCE)
>
>
>
> *Sony Belgium, bijkantoor van Sony Europe Ltd.*
>
> The Corporate Village ­ Da Vincilaan 7-D1 ­ B-1935 Zaventem ­ Belgium
>
>
>
> E-mail:                    Yves.DeMuyter@eu.sony.com<Vincent.Gaillez@eu.sony.com>
>
> Internet:                www.sony-europe.com
>
>
>
> Sony Europe Limited. A company registered in England and Wales.
>
> Registered Address: The Heights, Brooklands, Weybridge, Surrey, KT13 0XW,
> United Kingdom.
>
> Bank Account Details:
>
> Account Name: Sony Europe Limited € Account number: 624335508 € IBAN:
> BE63570624335508
>
> BIC: CITIBEBX € RPR Brussel / RPM Bruxelles: 0452161045 € VAT: BE0452161045
>
>
>
>
>
> [image: cid:image001.jpg@01CA1A63.F11B40A0]
>
>
>
> ************************************************************************
> The information contained in this message or any of its attachments may be
> confidential and is intended for the exclusive use of the addressee(s). Any
> disclosure, reproduction, distribution or other dissemination or use of
> this communication is strictly prohibited without the express permission of
> the sender. The views expressed in this email are those of the individual
> and not necessarily those of Sony or Sony affiliated companies. Sony email
> is for business use only. This email and any response may be monitored by
> Sony to be in compliance with Sony's global policies and standards
>

Received on Monday, 19 August 2013 13:09:45 UTC