You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2011/02/05 22:54:15 UTC

DO NOT REPLY [Bug 50723] New: Incorrect text underlines position for some fonts

https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

           Summary: Incorrect text underlines position for some fonts
           Product: Fop
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: fonts
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: alexander.chingarev@duallab.com


Created an attachment (id=26609)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26609)
zip contains both FO and PDF files

For some fonts text underlines may be incorrect. They are positioned upper than
they should be or disappear at all.

Quick investigation of those fonts and FOP sources shows that it depends on
sTypoAscender used in FOP.

Normally sTypoAscender is negative and underlines are positioned correctly in
this case.
If sTypoDecender is positive then text is crossed out instead of underlined. If
it's 0 then underline is invisible.

Attached are FO file and result PDF.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

Glenn Adams <gl...@skynav.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #2 from Jeremias Maerki <je...@apache.org> 2011-02-10 11:49:05 EST ---
It's a bit of both actually. See my comment on TTFFile.determineAscDesc(). I've
had to come up with some tricks to determine the best possible values for most
fonts. But Alexander now has some fonts where this doesn't work. I've spent
hours trying to improve this and I don't know if there's a better solution. If
anyone has one, I'm thankful but please do extensive tests with as many fonts
as possible!

The part that is a FOP issue is the determination of the underline position
(and thickness). We currently use a formula based on the baseline, ascender and
descender. See AbstractPathOrientedRenderer.renderTextDecoration(). Some fonts
(TrueType and Type 1) provide the desired position and thickness of the
underline (but not strike and overline). Ideally, we would of course use that.
If these values are reliable is, of course, another question again.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

Andreas L. Delmelle <ad...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |50483

--- Comment #6 from Andreas L. Delmelle <ad...@apache.org> 2011-02-22 19:28:19 EST ---
Seems like Mehdi's efforts in bug 50483 may offer an answer to my question. The
patch also touches TTFFile and, IIC, adds testing-infrastructure that might be
of use here (?)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #3 from Eugene Markovskyi <eu...@duallab.com> 2011-02-15 04:58:34 EST ---
Created an attachment (id=26660)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26660)
The validation of TrueType descenders.

Some times TrueTupe contains incorrect OS/2 ascender and descender, but hh
metrics is more correct. In this case the OS/2 descender value is positive or
equal to zero. We found a several fonts that have such problem.
In this patch the validation of descender value is added to function
TTFFile.determineAscDesc(). The validation of computed localAscender and
localDescender is added to TTFFile.guessVerticalMetricsFromGlyphBBox.
May such changes could make FOP more robust of font descenders problems?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #5 from Andreas L. Delmelle <ad...@apache.org> 2011-02-22 18:15:02 EST ---
Looking closer, this indeed seems like a fairly inconsequential (apart from
fixing the bug, obviously ;-P).

Still, endorsing and committing it would seem to require incorporating such a
font (hardcoding?) in the test suite... which would either make it dependent on
the font being locally available, or we would have to distribute such a font
(?)

Or is there another way to check this? Anyone?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #4 from Peter Coppens <pc...@gmail.com> 2011-02-22 16:44:59 EST ---
Wonder whether anyone of the fop community is willing to share viewpoints on
the approach taken in the patch. Seems a fairly safe change at first sight.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #9 from Glenn Adams <ga...@apache.org> 2012-04-21 05:08:00 UTC ---
(In reply to comment #3)
> Created attachment 26660 [details]
> The validation of TrueType descenders.
> 
> Some times TrueTupe contains incorrect OS/2 ascender and descender, but hh
> metrics is more correct. In this case the OS/2 descender value is positive or
> equal to zero. We found a several fonts that have such problem.
> In this patch the validation of descender value is added to function
> TTFFile.determineAscDesc(). The validation of computed localAscender and
> localDescender is added to TTFFile.guessVerticalMetricsFromGlyphBBox.
> May such changes could make FOP more robust of font descenders problems?

if you wish to have this patch considered, please provide a patch file, and not
an edited source file (for which I have no idea which revision you based it
upon)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #8 from Glenn Adams <gl...@skynav.com> 2012-04-07 01:44:27 UTC ---
resetting P2 open bugs to P3 pending further review

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #10 from Glenn Adams <ga...@apache.org> 2012-04-24 05:31:53 UTC ---
(In reply to comment #9)
> (In reply to comment #3)
> > Created attachment 26660 [details]
> > The validation of TrueType descenders.
> > 
> > Some times TrueTupe contains incorrect OS/2 ascender and descender, but hh
> > metrics is more correct. In this case the OS/2 descender value is positive or
> > equal to zero. We found a several fonts that have such problem.
> > In this patch the validation of descender value is added to function
> > TTFFile.determineAscDesc(). The validation of computed localAscender and
> > localDescender is added to TTFFile.guessVerticalMetricsFromGlyphBBox.
> > May such changes could make FOP more robust of font descenders problems?
> 
> if you wish to have this patch considered, please provide a patch file, and not
> an edited source file (for which I have no idea which revision you based it
> upon)

Alexander, I am still awaiting your input as requested above. if I see no
further input by April 30, I will close this bug due to lack of requested
information. Regards, Glenn

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

Bug 50723 depends on bug 50483, which changed state.

Bug 50483 Summary: [PATCH] Full font embedding and Subset embedding in Post Script
https://issues.apache.org/bugzilla/show_bug.cgi?id=50483

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #1 from Peter Coppens <pc...@gmail.com> 2011-02-10 09:55:56 EST ---
Does the FOP community consider this a font issue or a FOP problem? 

In case it is considered a FOP issue we are willing to contribute a patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50723] Incorrect text underlines position for some fonts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50723

--- Comment #7 from Mehdi Houshmand <me...@gmail.com> 2011-02-23 03:45:29 EST ---
I've added a bit of testing to the o.a.f.fonts.truetype package, some of which
would be of use here, but my patch is to be applied to the
Temp_TrueTypeInPostScript branch and would require some work to be ported to
trunk. (I assume this patch is for trunk, if not, feel free to ignore the above
statement)

As for testing... That is an area we are sadly complacent on and from my
experience with the fonts package, we want both unit tests (which you can
plagiarise from my patch) and we want to have more actual font files to test
with. The problem with fonts is that it's not always obvious where the bugs
are, so we need to test them as exhaustively as we can. 

In my patch, I've used "Droid Sans Mono" (a font I liberated from google's
Android) to test the behaviour of a mono-spaced font since it was under the
Apache license. The unit tests I've added are based on that and DejaVu which
was already supplied and would be fairly worthless without their inclusion.

In summary, no Andreas, to my knowledge there isn't another way to tests fonts
other than the methods you mention. But then, I'm still a little green when it
comes to FOP so someone else may have a better idea.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.