[x3d-public] text minor alignment

Roy Walmsley roy.walmsley at ntlworld.com
Wed Sep 9 05:14:45 PDT 2015


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

 

From: x3d-public [mailto:x3d-public-bounces at web3d.org] On Behalf Of Andreas Plesch
Sent: 09 September 2015 00:03
To: X3D Graphics public mailing list
Subject: [x3d-public] text minor alignment

 

I am trying to produce more correct text alignment with x3dom, and want to clarify my understanding of the minor alignment, the second value of the justify MFString field of the FontStyle node. My main reference is table 15.6 in the spec. at

 

http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/text.html#t-horizontalTRUE

 

where the different colors of the origin symbols signify minor alignment types.

 

In particular, I understand that 'FIRST' (black) is different from 'BEGIN' (red) in that 'FIRST' will align the base of the first line with Y=0 (x-axis) while 'BEGIN' will align the top of the first line with Y=0 (in the topToBottom case). I also understand that 'FIRST' is the default for minor alignment. Is this correct ?

 

[I am not quite sure why 'FIRST' is the default since it seems to require to take into account the size of the used font when accurately positioning text in a scene. Also, the size of a typeface referred to in its name refers to a box a bit larger than the distance from the lowest point of any glyph (say y) to the highest point (say $). This makes it generally hard to determine where the baseline of a font is just based on its nominal size.]

 

If my understanding is correct, the rendering of a default text node in a scene such as

 

http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/_pages/page01.html

 

should more or less look like this:

 

http://andreasplesch.github.io/x3dom/x3dom_text/alignment.xhtml

 

eg., the first line should be above the x-axis (green line).

 

However, the snapshot provided with scene in the web3d archive here

 

http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/FontStyle/_viewpoints/default.x3d._VP_Test_default_FontStyle_rendering.png

 

shows the first line underneath the x-axis, not above. This is where I am looking for clarification. The x3d browser used for the snapshot (xj3d?) may or may not faithfully adhere to the spec.

 

I may also try other browsers with the scene to see how they interprete the default positioning of a text node.

 

Thanks for any input,

 

Andreas




 

-- 

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/20150909/38e90c8f/attachment.html>


More information about the x3d-public mailing list