[ 
https://issues.apache.org/jira/browse/FOP-1896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124659#comment-18124659
 ] 

Jason Harrop commented on FOP-1896:
-----------------------------------

An FO showing the second defect (ascender and descender of 0) with a font from 
the test tree, AndroidEmoji.ttf, which has no d or p glyph and is the font 
TTFFileTestCase asserts the 0 for; and with Noto Sans Devanagari (OFL) as a 
font people use. Attached FOP-1896-ascender-descender.fo and 
FOP-1896-fonts.xconf; copy the config to the root of a checkout, adjust the 
Noto path, and render the area tree with the PDF renderer's fonts:
{noformat}
fop -c FOP-1896-fonts.xconf -fo FOP-1896-ascender-descender.fo -at 
application/pdf out.xml
{noformat}
Two blocks at 12pt, two emoji in AndroidEmoji and देवनागरी in Noto Sans 
Devanagari, both underlined.
On main at 5be8c69b6 both text areas have {{bpd="0" baseline="0"}} and so does 
each line area: the glyphs are drawn, but the line has no height and the 
underline sits on the baseline through the letters.
With the pull request's change the AndroidEmoji text area is {{bpd="16692" 
baseline="12888"}} (its hhea 2200 and -650 at 12pt) and the Devanagari one 
{{bpd="15648" baseline="10752"}} (896 and -408).
The first defect, a positive sTypoDescender, needs Wingdings or Lucida Sans, 
which I cannot attach; TTFFileTestCase in the pull request patches the value 
into AndroidEmoji and DejaVuLGCSerif in memory for that case.

> Incorrect text underlines position for some fonts
> -------------------------------------------------
>
>                 Key: FOP-1896
>                 URL: https://issues.apache.org/jira/browse/FOP-1896
>             Project: FOP
>          Issue Type: Bug
>          Components: font/unqualified
>    Affects Versions: 1.0
>         Environment: Operating System: All
> Platform: All
>            Reporter: Alexander Chingarev
>         Attachments: FOP-1896-ascender-descender.fo, FOP-1896-fonts.xconf, 
> TTFFile.java, underlines_issue.zip
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to