Bug 44531 - [PATCH] underline-position in font-face has wrong sign
Summary: [PATCH] underline-position in font-face has wrong sign
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: GVT Text (show other bugs)
Version: 1.8
Hardware: All All
: P3 minor
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks: 45598
  Show dependency tree
 
Reported: 2008-03-04 09:51 UTC by mg
Modified: 2009-07-22 07:32 UTC (History)
0 users



Attachments
SVG font with underline and overline text example (1.23 KB, image/svg+xml)
2008-03-04 09:51 UTC, mg
Details
Patch from proposal (962 bytes, patch)
2009-07-19 15:57 UTC, Helder Magalhães
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mg 2008-03-04 09:51:42 UTC
Created attachment 21625 [details]
SVG font with underline and overline text example

Attribute underline-position of element <font-face> seems to get negatived (-). Compared to attributes overline-position and strikethrough-position, this appears as unexpected. Apparently none of the SVG test fonts use underline-position and the default value looks fine. See getLineMetrics(int,int) in SVGGVTFont.java for the assignment to ulOffset without - in front of variable scale.

It might also be nice if stroke-width of underline would scale with font-size.
Comment 1 Helder Magalhães 2009-07-19 15:57:36 UTC
Created attachment 24006 [details]
Patch from proposal

(In reply to comment #0)
> Attribute underline-position of element <font-face> seems to get negatived (-).
> Compared to attributes overline-position and strikethrough-position, this
> appears as unexpected. Apparently none of the SVG test fonts use
> underline-position and the default value looks fine.

After investigating a bit, I've found that "samples/tests/spec/fonts/fontDecorations.svg" does use underline in a SVG font and, although no specific value is given to the "underline-position" property, just using underline seems to be enough (so I'd argue on the default value looking fine statement). ;-)


> See getLineMetrics(int,int) in SVGGVTFont.java for the assignment to ulOffset
> without - in front of variable scale.

The attached patch does exactly that. :-)  Fixes the attached test case and also improves look in "fontDecorations.svg". ;-)


> It might also be nice if stroke-width of underline would scale with font-size.

By taking a look at the source code and performing a quick test, it seems that it's already being done. Thing is the test case attached to this bug report uses a zero-width stroke, which intuitively would not scale (but I haven't double checked the specification regarding this; I'm not even sure if zero-width strokes should render...).
Comment 2 Helder Magalhães 2009-07-19 16:00:20 UTC
(Updating metadata to reflect a patch being available; Also, taking the opportunity to update a few bug properties.)
Comment 3 mg 2009-07-22 07:32:22 UTC
Thanks!