[x3d-public] text minor alignment

Andreas Plesch andreasplesch at gmail.com
Fri Sep 11 06:02:05 PDT 2015


This is getting a bit off topic but there is related question I would like
get feedback on. Currently, perhaps for some historic reason, x3dom centers
all text at the local origin by default, like justify='"MIDDLE" "MIDDLE"'
for single line text. It does that also for left aligned multi-line text,
eg. it centers the bounding box of the complete text box at the origin.

I believe that kind of alignment cannot be represented with a justify value
although it seems actually what may be expected not unreasonably by some as
a default positioning. '"MIDDLE" "MIDDLE"' for multi-line text would center
the box at the origin but at the same time also center all lines for a
middle alignment. Currently this positioning can only be achieved by using
a transform around the text and routing x-offsets into it. Even some
scripting is required for the simple math involved.

What this means is that perhaps a third value for the MFString justify
field would be needed,dealing with 'absolute' positioning of the major (x)
axis, similar to minor alignment. There may be a way to make this backwards
compatible as well.

Andreas




On Fri, Sep 11, 2015 at 8:26 AM, Andreas Plesch <andreasplesch at gmail.com>
wrote:

> Hello,
>
> as I looked into the 'length' and 'maxExtent' fields of the text node, I
> noticed similar issues with snapshots for the NIST conformance example
> scenes. For those fields it turns out that they are not widely supported in
> players, sofar only BS Contact seems to have support while freeWrl,
> view3dscene and InstantPlayer do not.
>
> I think both 'length' and 'maxExtent' could be implemented for x3dom due
> to the way it renders text. 'length' is very similar to the maxWidth
> parameter of ctx.fillText() for canvas, and maxExtent is defining a texture
> mapping.
>
> Andreas
>
>
> On Wed, Sep 9, 2015 at 5:07 PM, Roy Walmsley <roy.walmsley at ntlworld.com>
> wrote:
>
>> Andreas,
>>
>>
>>
>> Thanks for the  update. Perhaps all it needs is for the snapshot to be
>> regenerated, and also the first slide in the show.
>>
>>
>>
>> Roy
>>
>>
>>
>> *From:* Andreas Plesch [mailto:andreasplesch at gmail.com]
>> *Sent:* 09 September 2015 21:43
>> *To:* Roy Walmsley
>> *Cc:* X3D Graphics public mailing list
>> *Subject:* Re: [x3d-public] text minor alignment
>>
>>
>>
>> Hello Roy,
>>
>> thanks for reviewing this issue. In the mean time I had opportunity to
>> view the scene with freeWrl and InstantPlayer. Both render the scene as
>> expected, eg. with the first line above the x-axis while its baseline just
>> touches it. So I think something was a bit off when the snapshot on the
>> archive web site was generated.
>>
>> Andreas
>>
>>
>>
>>
>>
>> On Wed, Sep 9, 2015 at 8:14 AM, Roy Walmsley <roy.walmsley at ntlworld.com>
>> wrote:
>>
>> Andreas,
>>
>>
>>
>> I have reviewed your comments below and find that I am in agreement with
>> you.
>>
>>
>>
>> You are correct in saying that the default for the /justify/ field is
>> [“BEGIN” “FIRST”]. This is quite clearly stated in 15.2.2.3 of the 19775-1
>> specification.
>>
>>
>>
>> Then, when /horizontal/ is TRUE and /topToBottom/ is TRUE, which both are
>> by default, Table 15.4 in the 19775-1 specification states that when the
>> minor alignment is “FIRST” the baseline of the first line shall be aligned
>> with the origin.
>>
>>
>>
>> The inevitable conclusion is that the figure displaying the NIST
>> Conformance for the default field settings is incorrect. I will raise this
>> issue for discussion at the next available opportunity. Please keep us
>> informed of any further findings.
>>
>>
>>
>> Great catch. Thank you.
>>
>>
>>
>> Regards,
>>
>>
>>
>> Roy
>>
>>
>>
>>
>> --
>>
>> Andreas Plesch
>> 39 Barbara Rd.
>> Waltham, MA 02453
>>
>>
>>


-- 
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20150911/6fbc691e/attachment.html>


More information about the x3d-public mailing list