[x3d-public] text minor alignment

Andreas Plesch andreasplesch at gmail.com
Tue Sep 8 16:02:59 PDT 2015


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/20150908/9d1405d0/attachment.html>


More information about the x3d-public mailing list