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

Simon Steiner edited comment on FOP-3015 at 1/21/22, 10:36 AM:
---------------------------------------------------------------

Can you try adobe reader instead of a browser pdf viewer


was (Author: ssteiner1):
Can you try adobe reader

> The color of the Chinese font of word to pdf turns to black.(simulate-style )
> -----------------------------------------------------------------------------
>
>                 Key: FOP-3015
>                 URL: https://issues.apache.org/jira/browse/FOP-3015
>             Project: FOP
>          Issue Type: Bug
>          Components: renderer/pdf
>    Affects Versions: 2.5
>            Reporter: wym
>            Assignee: Simon Steiner
>            Priority: Major
>             Fix For: 2.5
>
>         Attachments: pr.docx
>
>
> Hello, it is found in Fop 2.5 that after adding the bold configuration 
> (simulate-style=true), the color of the Chinese font of word to pdf turns to 
> black.
> {color:#00875a}*docx xml:*{color}
> <?xml version="1.0" encoding="utf-8"?>
>  <fo:root
>  xmlns:fo="http://www.w3.org/1999/XSL/Format";
>  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006";>
>  <layout-master-set
>  xmlns="http://www.w3.org/1999/XSL/Format";
>  xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml";
>  xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml";
>  xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml";
>  xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex";
>  xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid";
>  
> xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash";
>  xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex";
>  
> xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing";>
>  <simple-page-master margin-bottom="17mm" margin-left="1.25in" 
> margin-right="1.25in" margin-top="15mm" master-name="s1-simple" 
> page-height="297mm" page-width="210mm">
>  <region-body column-count="1" column-gap="0.3in" margin-bottom="22.0pt" 
> margin-left="0mm" margin-right="0mm" margin-top="29.0pt"/>
>  <region-before extent="0.0pt" region-name="xsl-region-before-simple"/>
>  <region-after extent="0.0pt" region-name="xsl-region-after-simple"/>
>  </simple-page-master>
>  <page-sequence-master master-name="s1">
>  <repeatable-page-master-alternatives>
>  <conditional-page-master-reference master-reference="s1-simple"/>
>  </repeatable-page-master-alternatives>
>  </page-sequence-master>
>  </layout-master-set>
>  <fo:page-sequence force-page-count="no-force" id="section_s1" format="" 
> master-reference="s1">
>  <fo:static-content flow-name="xsl-footnote-separator">
>  <fo:block>
>  <fo:leader rule-thickness="0.5pt" rule-style="solid" leader-length="100%" 
> leader-pattern="rule"/>
>  </fo:block>
>  </fo:static-content>
>  <fo:flow flow-name="xsl-region-body">
>  <fo:block break-before="auto" font-size="26.0pt" text-align="center">
>  <inline
>  xmlns="http://www.w3.org/1999/XSL/Format"; font-size="26.0pt" 
> font-weight="bold">
>  <inline font-family="STFangsong">测试颜色 </inline>
>  </inline>
>  <inline
>  xmlns="http://www.w3.org/1999/XSL/Format"; color="#FF0000" font-size="26.0pt" 
> font-weight="bold">
>  <inline font-family="STFangsong">测试颜色</inline>
>  </inline>
>  </fo:block>
> {color:#00875a}*possible problems:*{color}
> it was found that possible problems appeared here 
> org.apache.fop.render.pdf.PDFPainter
> private void drawTextWithDX(int x, int y, String text, FontTriplet triplet,
>  int letterSpacing, int wordSpacing, int[] dx) throws IFException {
>  .......
>  boolean simulateStyle = tf instanceof CustomFont && ((CustomFont) 
> tf).getSimulateStyle();
>  if (simulateStyle) {
>  if (triplet.getWeight() == 700) {
>  generator.add("q\n");
> // *{color:#ffab00}possible problems appeared here,after the change{color}*
>  +{color:#de350b}*float[] comps1 = 
> state.getTextColor().getComponents((float[])null);*{color}+
>  +{color:#de350b}*generator.add(comps1[0]+" "+comps1[1]+" "+comps1[2]+" 
> RG\n");*{color}+
>  generator.add("2 Tr 0.31543 w\n");
>  }
>  ......
>  }
> *{color:#00875a}test docx:{color}*     [^pr.docx]
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to