2017-11-27 11 views
1

간단한 PDF 보고서를 생성하기 위해 FONET 앱을 개발 중입니다. 클라이언트가 등록 상표 심볼을 위 첨자 레벨로 올바르게 올리는 것을 원한다는 것을 제외하고는 모든 것이 작동합니다.FONET/FOP 위첨자; 인라인 컨테이너가 전혀 나타나지 않습니다.

성공한 인라인 요소에서 text-altitude을 시도 했으므로 인터넷의 비참한 XSL : FO 문서를 조사한 결과 fo:inline-container에 포장해야한다고 생각했습니다. 그러나 그것은 전혀 나타나지 않습니다.

나는이 basic example 사용하여 줄이려고했습니다

<?xml version="1.0" encoding="utf-8"?> 
<!-- inline-container-Converts-Block-to-Inline.fo 
- Copyright (c) 2016, HerongYang.com, All Rights Reserved. 
--> 
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
<fo:layout-master-set> 
    <fo:simple-page-master master-name="page" 
    margin="0.1in" page-height="4in" page-width="3in"> 
    <fo:region-body region-name="body" background-color="#eeeeee"/> 
    </fo:simple-page-master> 
</fo:layout-master-set> 
<fo:page-sequence master-reference="page"> 
    <fo:flow flow-name="body"> 
    <fo:block margin="0.1in" padding="0.2in" 
    border-width="1px" border-style="solid" 
    background-color="#eeffff" color="#000000" 
    font-family="sans-serif" font-size="10pt"> 
    Once upon a time 
    <fo:inline-container width="0.7in" margin="0in" 
    alignment-baseline="middle"> 
    <fo:block background-color="#eeeeee" margin="0in" 
    border-width="1px" border-style="solid" 
    padding="4px">there were three little pigs</fo:block> 
    </fo:inline-container> 
    who lived with their Mother. 
    Early one morning they woke up and their mother said, 
    "<fo:inline font-style="italic" color="#ff22ff">you're too big 
    for this house and its time you left home.</fo:inline>" 
    </fo:block> 
    </fo:flow> 
</fo:page-sequence> 
</fo:root> 

을하고 그것을 실행하려고하지만,이 또한 inline-container에서 아무것도 표시되지 않습니다; this online processor에서 시도해 보았습니다. 또한 FONET 문제뿐만 아니라 컨테이너의 내용도 표시되지 않습니다.

FONET은 FOP 0.2의 포트이며, text-altitudeinline-container 모두에 대해 should have basic support입니다.

무엇이 누락 되었습니까? 이 FOP 버전에서 위 첨자 효과를 얻을 수 있습니까?

답변

3

연결 한 준수 페이지는 fo:inline-container이 지원되지 않음을 나타냅니다. 최신 FOP (https://xmlgraphics.apache.org/fop/compliance.html)에는 부분 지원 만 있습니다.

나는 그것이 일하기 위해 노력하고 있었기 때문이라고 가정하지만, 0.7in 너비의 공간에 "작은 돼지 3 마리"를 넣으면 fo:inline-container의 크고 좁은 지역이됩니다.

좋은 소식은 위 첨자를 작성하는 데 fo:inline-container이 필요하지 않다는 것입니다. fo:inlinebaseline-shift="super" (https://www.w3.org/TR/xsl11/#baseline-shift 참조)을 사용하면됩니다.

은 또한 모두가합니다 (FO 포맷터는 해당한다고 가정하지 때문에) 첨자 텍스트의 font-size을 줄이고 조상 FO에 line-height-shift-adjustment="disregard-shifts"을 (https://www.w3.org/TR/xsl11/#line-height-shift-adjustment 참조)를 추가하는 것을 고려 할 수 있습니다 '첨자 아무튼 그래서 https://www.antennahouse.com/antenna1/comprehensive-xsl-fo-tutorials-and-samples-collection/


마지막 resor에

<fo:block line-height-shift-adjustment="disregard-shifts" 
     margin="0.1in" padding="0.2in" 
     border-width="1px" border-style="solid" 
     background-color="#eeffff" color="#000000" 
     font-family="sans-serif" font-size="10pt"> 
    Once upon a time<fo:inline 
    baseline-shift="super" font-size="0.8em">®</fo:inline> 
    there were three little pigs<fo:inline 
    baseline-shift="super" font-size="0.8em">®</fo:inline> 
    who lived with their Mother. 
    Early one morning they woke up and their mother said, 
    "<fo:inline font-style="italic" color="#ff22ff">you're too big 
    for this house and its time you left home.</fo:inline>" 
</fo:block> 

는 또한 "종합 XSL-FO 자습서 및 샘플 컬렉션"의 "문자 스타일 설정"을 참조하십시오 : t은 행 높이를 변경 귀하의 FO 포맷터가 baseline-shift을 구현하지 않을 때 t는 위 첨자 모양의 등록 상표 기호가있는 글꼴을 찾는 것입니다. Windows 'Character Map'유틸리티를 통한 빠른 트롤은 'Calibri'에 하나가 있다는 것을 보여 줬습니다.

+0

불행하게도 온라인 FOP 1.0 프로세서에서 기준선 이동이 완벽하게 작동하지만 .NET 라이브러리가 포트 인 FOP 0.2에 있지 않으므로 코드에서 작동하지 않습니다. 슈퍼 스크립트에 다른 트릭이 있습니까? – Whelkaholism

+2

죄송합니다. 'baseline-shift'는 위 첨자를 만들기 위해 디자인 된 속성입니다. 유일한 희망은 위 첨자 모양의 등록 상표 기호가있는 글꼴을 찾는 것입니다. Windows 'Character Map'유틸리티를 통한 빠른 트롤은 'Calibri'에 하나가 있다는 것을 보여 줬습니다. 다른 사람이있을 수 있습니다. 또는 더 많은 XSL 1.1을 구현하는 다른 FO 포맷터를 사용해 볼 수도 있습니다. –

+1

Apache FOP 0.2.5가 2003 년 7 월 18 일에 릴리스되었습니다. 이는 14 년 전이었습니다. 소프트웨어를 사용하는 실제 서비스는 지난 몇 년 동안 개발 된 것이지 10 년이나 2 년 전이 아닙니다. –

관련 문제