Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 22nd, 2014, 02:06 AM
jimmyhartington jimmyhartington is offline
Regular Contributor
 
Join Date: Nov 2012
Posts: 63
Default Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

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/...%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/...%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.
__________________
Kind regards Jimmy Hartington

-------
Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote
  #2  
Old January 22nd, 2014, 09:27 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,468
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

Quote:
Originally Posted by jimmyhartington View Post
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/...%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:



Where is the text "squashed together?"

Quote:
Originally Posted by jimmyhartington View Post
If I set the same text in InDesign with Arial Unicode it looks fine.
See this pdf:
https://dl.dropboxusercontent.com/u/...%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.
Quote:
Originally Posted by jimmyhartington View Post
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.
Attached Images
File Type: jpg Carla Connolly - Chinese.pdf.jpg (144.3 KB, 46 views)
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #3  
Old January 22nd, 2014, 12:55 PM
jimmyhartington jimmyhartington is offline
Regular Contributor
 
Join Date: Nov 2012
Posts: 63
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

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.
__________________
Kind regards Jimmy Hartington

-------
Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote
  #4  
Old January 23rd, 2014, 04:26 AM
jimmyhartington jimmyhartington is offline
Regular Contributor
 
Join Date: Nov 2012
Posts: 63
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

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:
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?
__________________
Kind regards Jimmy Hartington

-------
Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote
  #5  
Old January 23rd, 2014, 09:07 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,468
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

Quote:
Originally Posted by jimmyhartington View Post
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?
Quote:
Originally Posted by jimmyhartington View Post
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:
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.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #6  
Old January 23rd, 2014, 09:23 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,468
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

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?
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #7  
Old January 23rd, 2014, 11:21 PM
jimmyhartington jimmyhartington is offline
Regular Contributor
 
Join Date: Nov 2012
Posts: 63
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

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.


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?
__________________
Kind regards Jimmy Hartington

-------
Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote
  #8  
Old January 28th, 2014, 05:48 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,468
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

Quote:
Originally Posted by jimmyhartington View Post
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.
Quote:
Originally Posted by jimmyhartington View Post
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.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #9  
Old January 28th, 2014, 11:14 PM
jimmyhartington jimmyhartington is offline
Regular Contributor
 
Join Date: Nov 2012
Posts: 63
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

Quote:
Originally Posted by Dan Korn View Post
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.
__________________
Kind regards Jimmy Hartington

-------
Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote
  #10  
Old January 28th, 2014, 11:54 PM
jimmyhartington jimmyhartington is offline
Regular Contributor
 
Join Date: Nov 2012
Posts: 63
Default Re: Chinese charactes with Arial Unicode - Other with Akzidenz Grotesk

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?
__________________
Kind regards Jimmy Hartington

-------
Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.