Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #27039

    Hi

    We were using PD4ML version 361, now we have upgraded to latest one

    Now we have a problem with the font

    for example,
    for the paragraphs which contain both the english and chinese characters are rendered with the Mingliu font we are using for chinese

    the below is our piece of code.


    WENJUN Money 育暮趣所及定平関島指形由幹設 Laundering in UNITED KINGDOM IS NOT functional now

    style used is,

    .match-text{font-size: 11pt;font-family: Times New Roman,MingLiu;}

    In the old version of PD4ML, we were getting the english in times new roman and only the chinese characters in the Mingliu font. But in the latest pd4ml version, we are seeing everything on the Mingliu font version and not getting the correct style we expected.

    Please help us to resolve this issue

    Regards
    Sarin

    #29814

    Do you have a font mapping for Times New Roman in pd4fonts.properties? Does it load the .ttf file during a conversion?

    Times New Roman=times.ttf

    #29815

    Yes, we have defined this in pd4fonts.properties

    Arial=arial.ttf
    Arial Bold=arialbd.ttf
    Arial Bold Italic=arialbi.ttf
    Arial Italic=ariali.ttf
    Courier New=cour.ttf
    Courier New Bold=courbd.ttf
    Courier New Bold Italic=courbi.ttf
    Courier New Italic=couri.ttf
    Times New Roman=times.ttf
    Times New Roman Bold=timesbd.ttf
    Times New Roman Bold Italic=timesbi.ttf
    Times New Roman Italic=timesi.ttf
    Calibri Bold=calibribd.ttf
    Calibri=calibri.ttf
    Calibri Italic=Calibrii.ttf
    MingLiU=mingliu.ttc_0

    The issue happens only when the english and chinese characters inside one span or tag, If the chinese in in another span, it is working properly. But in our case, it will come together inside one span, please help us to resolve this. Otherwise it would a big blow for us as the existing functionality will be broken with the upgrade

    Regards
    Sarin

    #29816

    We plan to address the issue on Monday. I’ll let you know asap.

    #29817

    Ok, thanks, we will wait for your reply

    #29818

    Hello PD4ML support, please can you respond on this issue as this is blocking our timelines and resources.

    #29819

    Sorry it takes that long. We’ve been still working on the issue. I’ll let you know.

    #29820

    In current DEV build we implemented a solution for the issue. It is a very sensitive part of the rendering engine and the patched version still cannot pass QA by “exotic” test cases (a mix of Chinese and Arabic scripts), so we made the patch conditionally switchable on/off. Currently by default it is switched off.

    In order to enable it you should either run your Java (app server?) with the following JVM parameter:

    -Dpd4ml.fix.20150816=true

    Alternatively you may trigger PD4ML API to achieve the same effect:

    HashMap map = new HashMap();
    map.put( PD4Constants.PD4ML_FIX20150816, “true” );
    pd4ml.setDynamicParams(map);

    Hopefully the workaround is ok for you.

    We currently work on a totally refactored PD4ML v4.x, which should implicitly solve such kind of issues.

    We’ll send you an updated library by request to support pd4ml com

    #29821

    Hi,

    thank you for your solution. Would like to know,

    Whether we have any workaround without upgrading the library, we are using the v397 licenced version and not easy to change the JAR again. Do we have any workaround where we can solve this.

    we really appreciate your support, please give us some suggestions how we can fix this

    Regards
    Sarin

    #29822

    A workaround is to preprocess input HTML and to isolate CJK portions of text to separate spans.


    WENJUN Money 育暮趣所及定平関島指形由幹設 Laundering in UNITED KINGDOM IS NOT functional now

    to


    WENJUN Money
    育暮趣所及定平関島指形由幹設 Laundering in UNITED KINGDOM IS NOT functional now

    Is it doable on your side?

    #29823

    thanks for your support
    we have changed it to call this function before showing the content

    import java.util.regex.Matcher;
    import java.util.regex.Pattern;

    public class CJKFinder {

    public static void main(String[] args) {
    String str = ” 育暮 1 Great Work M R 12 13 14 育暮趣所及定平関島指形由幹設世戸 122 育暮趣所$及定平関 島指形由幹設世戸 hello. aiguë διαίρεσις”;
    System.out.println(applyCJKStyle(str));
    }

    public static String applyCJKStyle(String text){
    Pattern pattern = Pattern.compile(“([u4E00-u9FFF]{1,})”);
    Matcher matcher = pattern.matcher(text);
    StringBuffer output = new StringBuffer();
    while (matcher.find()){
    matcher.appendReplacement(output, “$1“);
    }
    matcher.appendTail(output);
    return output.toString();
    }

    }

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.