jimmyhartington Posted January 22, 2014 Share Posted January 22, 2014 I have a business card in which the name and titel is in chinese. When I tested it the chinese characters worked fine. The font used is Arial Unicode. But now there are latin characters in between the chinese characters. Like this "GD工程公司". And then the result is not good. See this pdf on page 2. https://dl.dropboxusercontent.com/u/1372858/Carla%20Connolly%20-%20%20Chinese.pdf The latin characters gets squashed together. If I set the same text in InDesign with Arial Unicode it looks fine. See this pdf: https://dl.dropboxusercontent.com/u/1372858/Arial%20Unicode.pdf So now I am looking for a solution to this. Would it be possible via JavaScript to set all chinese characters with Arial Unicode and all other with Akzidenz Grotesk? This template is available to my customer through MarcomCentral. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 22, 2014 Share Posted January 22, 2014 I have a business card in which the name and titel is in chinese. When I tested it the chinese characters worked fine. The font used is Arial Unicode. But now there are latin characters in between the chinese characters. Like this "GD工程公司". And then the result is not good. See this pdf on page 2. https://dl.dropboxusercontent.com/u/1372858/Carla%20Connolly%20-%20%20Chinese.pdf The latin characters gets squashed together. Sorry, I'm missing what the problem is. Here is a screenshot of what the file looks like to me in Acrobat XI: http://forums.pti.com/attachment.php?attachmentid=965&stc=1&d=1390411075 Where is the text "squashed together?" If I set the same text in InDesign with Arial Unicode it looks fine. See this pdf: https://dl.dropboxusercontent.com/u/1372858/Arial%20Unicode.pdf So now I am looking for a solution to this. Would it be possible via JavaScript to set all chinese characters with Arial Unicode and all other with Akzidenz Grotesk? Possibly. I would need to take look at the job. This template is available to my customer through MarcomCentral. Could this be an issue with the PDF preview in MarcomCentral? Again, the PDF itself looks fine to me in Acrobat. Quote Link to comment Share on other sites More sharing options...
jimmyhartington Posted January 22, 2014 Author Share Posted January 22, 2014 Hi Dan Sorry. I forgot to clarify. The business card is two-sided and the chinese is on page two. And here it is garbled in Acrobat as well. It seems that the word spacing is set very low according to Pitstop. http://img842.imageshack.us/img842/7044/gbva.png Quote Link to comment Share on other sites More sharing options...
jimmyhartington Posted January 23, 2014 Author Share Posted January 23, 2014 It seems to be a problem with the Arial Unicode font and FusionPro. Other fonts with chinese characters works. But the fonts I have at my availability does not have all the Chinese characters, but Arial Unicode MS has. I am now pursuing a method to prefix each character with the font tag based on their unicode value. A web-developer from my company has helped me writing a JavaScript, to do this, but we can not get it to work. Here is the code: getText(Field("Name")); function getText(input){ var output = ""; for(var i = 0; i < input.length;i++){ if(input[i].matches("^[\u0000-\u0080]+$")){ output += '<f name="Helvetica">'+input[i]; } else { output += '<f name="Arial Unicode MS">'+input[i]; } } return output; } But it errors like this: http://img716.imageshack.us/img716/61/5g1h.png Is matches not a function, which FusionPro understands? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 23, 2014 Share Posted January 23, 2014 Hi Dan Sorry. I forgot to clarify. The business card is two-sided and the chinese is on page two. And here it is garbled in Acrobat as well. It seems that the word spacing is set very low according to Pitstop. Okay, I see the problem now. Can you post a sample job which reproduces the problem? It seems to be a problem with the Arial Unicode font and FusionPro. Other fonts with chinese characters works. But the fonts I have at my availability does not have all the Chinese characters, but Arial Unicode MS has. I am now pursuing a method to prefix each character with the font tag based on their unicode value. A web-developer from my company has helped me writing a JavaScript, to do this, but we can not get it to work. Here is the code: getText(Field("Name")); function getText(input){ var output = ""; for(var i = 0; i < input.length;i++){ if(input[i].matches("^[\u0000-\u0080]+$")){ output += '<f name="Helvetica">'+input[i]; } else { output += '<f name="Arial Unicode MS">'+input[i]; } } return output; }But it errors like this: Is matches not a function, which FusionPro understands? There is a JavaScript function String.match, not String.matches. However, in the version of FusionPro you're using, the Chinese characters are actually expressed as hex digits between <unicode> tags. So what you would actually have to do is a bit more complex. But if you can post the job, I can probably come up with a simpler solution. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 23, 2014 Share Posted January 23, 2014 Also, I see that the file you attached was composed in MarcomCentral, with FusionPro 9.2. Do you get the same output when you compose locally (on your machine) with 9.0? Quote Link to comment Share on other sites More sharing options...
jimmyhartington Posted January 24, 2014 Author Share Posted January 24, 2014 I have not been able to reproduce it locally on my mac, but that is because I can not get FusionPro to accept my unicode text file to show the characters. Asian-support is checked in advanced settings and limit to mac-roman is not checked in compose. But it still not works locally. So to test it I uploaded the template to MarcomCentral. And did the testing. Just forgot to test the combination of latin and chinese characters together in a field with Arial Unicode. When importing my text file locally I only get these options. http://img822.imageshack.us/img822/5598/iiph.png But here is a sample job. I used the collect to zip. Is that enough? Sample job And by the way. Is FusionPro 9.2 released yet? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 29, 2014 Share Posted January 29, 2014 I have not been able to reproduce it locally on my mac, but that is because I can not get FusionPro to accept my unicode text file to show the characters. Asian-support is checked in advanced settings and limit to mac-roman is not checked in compose. ... But here is a sample job. I used the collect to zip. Is that enough? Sample job Thanks. That shows me a couple of issues. One is that, if you're going to use a Unicode data file, it needs to have a byte order mark. Open the file in an editor that shows the encoding, such as TextWrangler or Notepad2, and save the file as "UTF-8 with BOM" or "UTF-8 with signature". Then FusionPro will detect the Unicode encoding. The drop-down list in the Data Source Wizard has no relevance here; as the label notes, that's to specify a non-Unicode encoding. With the correct data file encoding, with the byte order marker, I am able to compose the job. It appears that there is some kind of font problem. This will require further analysis. And by the way. Is FusionPro 9.2 released yet? No. Is there a specific reason you're asking? There's nothing in 9.2 which would affect how this job composes, as far as I know. In fact, it is being composed with 9.2 in MarcomCentral. Quote Link to comment Share on other sites More sharing options...
jimmyhartington Posted January 29, 2014 Author Share Posted January 29, 2014 No. Is there a specific reason you're asking? There's nothing in 9.2 which would affect how this job composes, as far as I know. In fact, it is being composed with 9.2 in MarcomCentral. I just wondered since if was not the same version I use locally, then perhaps it did not work quite the same. I will try the solution with the byte order mark and see if this solves it. Thanks for all your help. Quote Link to comment Share on other sites More sharing options...
jimmyhartington Posted January 29, 2014 Author Share Posted January 29, 2014 I have now tried it, but it gives the same, so it could be a font issue. I then tried another font with chinese characters. But as you can see on page 2 it has the same contraction of the latin characters. Other font So I think I have to follow the road of tagging all latin characters with one font tag and all other with another font tag. If my first script attempt did not work, would it be easy to change to only find the latin characters and tag them with the font Akzidenz Grotesk, and then tag all other with Arial Unicode? Quote Link to comment Share on other sites More sharing options...
jimmyhartington Posted January 29, 2014 Author Share Posted January 29, 2014 I have now tried to make a new rule. And it kind of works. var input = Field("Name other language") var output = ""; var patt1 = "[a-zA-Z ]" for(var i = 0; i < input.length;i++){ if(input[i].match(patt1)){ output += '<f Name="Akzidenz-Grotesk Pro Bold">'+input[i]; } else { output += '<f name="Arial Unicode MS">'+input[i]; } } return output; } This is the result from this input "GD工程公司": <f Name="Akzidenz-Grotesk Pro Bold">G<f Name="Akzidenz-Grotesk Pro Bold">D<f name="Arial Unicode MS"><<f Name="Akzidenz-Grotesk Pro Bold">u<f Name="Akzidenz-Grotesk Pro Bold">n<f Name="Akzidenz-Grotesk Pro Bold">i<f Name="Akzidenz-Grotesk Pro Bold">c<f Name="Akzidenz-Grotesk Pro Bold">o<f Name="Akzidenz-Grotesk Pro Bold">d<f Name="Akzidenz-Grotesk Pro Bold">e<f name="Arial Unicode MS">><f name="Arial Unicode MS">5<f Name="Akzidenz-Grotesk Pro Bold">d<f Name="Akzidenz-Grotesk Pro Bold">e<f name="Arial Unicode MS">5<f name="Arial Unicode MS">7<f Name="Akzidenz-Grotesk Pro Bold">a<f name="Arial Unicode MS">0<f Name="Akzidenz-Grotesk Pro Bold">b<f name="Arial Unicode MS">5<f name="Arial Unicode MS">1<f name="Arial Unicode MS">6<f Name="Akzidenz-Grotesk Pro Bold">c<f name="Arial Unicode MS">5<f name="Arial Unicode MS">3<f Name="Akzidenz-Grotesk Pro Bold">f<f name="Arial Unicode MS">8<f name="Arial Unicode MS"><<f name="Arial Unicode MS">/<f Name="Akzidenz-Grotesk Pro Bold">u<f Name="Akzidenz-Grotesk Pro Bold">n<f Name="Akzidenz-Grotesk Pro Bold">i<f Name="Akzidenz-Grotesk Pro Bold">c<f Name="Akzidenz-Grotesk Pro Bold">o<f Name="Akzidenz-Grotesk Pro Bold">d<f Name="Akzidenz-Grotesk Pro Bold">e<f name="Arial Unicode MS">> So I can see that the font tags change based on the characters. But it does not work with the unicode characters anyway. How could I modify my rule to work the unicode characters? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.