SVG claims feature#Text but does not do baseline-alignment or vertical text

Issue #12052362 • Assigned to Steven K.

Details

Author
Gerald R.
Created
May 17, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14393
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

SVG claims feature#Text but does not follow spec.

SVG text does not obey alignment-baseline value such as "central".

When Chinese text is rendered with attribute writing-mode="tb-rl", then it is painted vertically. However, the SVG spec states that vertical writing implies attribute dominant-baseline="central", so characters should be centered on the vertical line. Instead, they are painted to the right of the line.

Go to this link

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/alignment-baseline

and look at the "live sample". In Edge, all glyphs are painted above the origin. In Chrome, the painting is appropriate.

Or load this image:

https://upload.wikimedia.org/wikipedia/commons/9/9b/SVG_Test_TextAlign.svg

The Chinese characters should be centered about the vertical line, but they are not. Chrome centers them.

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

      Changed Assigned To to “Bogdan B.”

      Changed Status

    • Thanks for your feedback! I duped this to the existant entry for dominant-baseline in our feature backlog.

    • This issue has been resolved External. This means this issue may require a new feature to be implemented or other work that is more significant than a typical bug. You may be able to find more information on this issue by searching for related features on status.microsoftedge.com and uservoice.microsoftedge.com.

    • Changed Status

    • If Edge does not support the various baseline alignment options, then it should not claim to support the feature strings

      Both of those strings require support of the text element.

      See SVG 1.1 Appendix 0:

      http://www.w3.org/TR/SVG/feature.html

      The specification for the text element is found at

      http://www.w3.org/TR/SVG/text.html#TextElement

      To render text, a user agent must support presentation attributes (which include some baseline attributes). Edge does not support the attributes, so it should not claim to support the feature.

      If Edge does not implement the feature, then Edge should not claim the feature. Deleting the feature strings is a simple fix: don’t overclaim.

      BTW, failing to support feature#Text means that

      *http://www.w3.org/TR/SVG11/feature#SVG-static

      must also be removed from the feature list because it requires feature#Text.

      I could not find a reference for “dominant-baseline” in Edge status as Francois R. suggests. None of the SVG entries seemed appropriate.

      I did find:

      https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/7887774-support-dominant-baseline-in-text-element-in-svg

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

    • Hi Gerald,

      The SVG Text feature requires support for the <text> element (which we do support) and not all variants of all the properties that could be set on it. I do not believe us reporting we support the <text> element to be wrong just because we don’t support dominant-baseline yet.

      We do know about the missing feature though, and it’s on our backlog.  Appreciate the detailed submission and the support.

      regards,

      The MS Edge Team

    • No, the #Text feature requires far more support than just text. It requires support for textPath, and 10.13.3 describes how that sub-element interacts with the baseline: “Align the glyph vertically relative to the midpoint-on-the-path based on property ‘alignment-baseline’ and any specified values for attribute ‘dy’ on a ‘tspan’ element. In the example above, the ‘alignment-baseline’ property is unspecified, so the initial value of alignment-baseline:baseline will be used. There are no ‘tspan’ elements; thus, the baseline of the glyph is aligned to the midpoint-on-the-path.”

      If you claim #Text, then you must handle baseline alignments. MS SVG does not.

      The feature #BasicText requires support for text element but not textPath.

      But MS doesn’t support the text element because MS doesn’t support all the attributes.

      A claim that MS need not support all its properties is absurd. Do you think it is kosher to support the x attribute but not the y attribute? The specification at http://www.w3.org/TR/SVG/text.html section 10.1 says characters are shapes and subject to transforms. Do you think it kosher to implement text without transforms? Where is the place in the specification that says one need not implement all the attributes listed for an element?

      What’s the point of a spec if different companies say we didn’t implement that feature because we didn’t think we needed it – but we decided to claim credit for implementing it.

      Look at the spec at 10.3, which comments about baselines, and then says "In addition to the font characteristics required above". Baseline support for fonts is a requirement. It is not optional. MS does not get to decide what is optional in the spec.

      If you don’t follow the spec for the text element, then don’t claim to follow it. MS may wish to follow the spec, but if MS doesn’t follow it yet is not an excuse to overclaim that it does.

      Your implementation of SVG text is seriously broken in many respects and has known about some broken features for years. Your implementation does not implement direction correctly. It does not do the Unicode Bidirectional Algorithm (UBA/BIDI) correctly. It does not do baseline alignment (this bug report). It does not do baseline adjustments for Arabic (Arabic baseline is different from the Latin baseline.)

      Yes, some features are optional. MS doesn’t need to claim the ones it does not implement.

      The specification at http://www.w3.org/TR/SVG/i18n.html#I18nTextSubstitution I.2 states:
      SVG supports:
      *Horizontal, left-to-right text found in Roman scripts (see the ‘writing-mode’ property)
      *Vertical and vertical-ideographic text (see the ‘writing-mode’ property)
      *Bidirectional text (for languages such as Arabic and Hebrew - see the ‘direction’ and ‘unicode-bidi’ properties)

      If you aren’t going to fix these problems in a hurry, then do not claim the features.

    You need to sign in to your Microsoft account to add a comment.

    Sign in