Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

5
08.01.2007 Page 1 of 5 SAP Note Number 776507 SAPscript/SmartForms: Which fonts for which languages? Note Language: English Version: 4 Validity: Valid from 22.08.2005 Summary Symptom Documents printed via SAPscript or SmartForms do not print with correct special characters, e.g. ### prints instead of Japanese or Russian characters. What to do? More Terms SAPscript, SmartForms, printing, device types, OTF Cause and Prerequisites Help required to choose proper fonts in a SAPscript or SmartForm Solution When using SAPscript or SmartForms to print (or email or fax) a form from a business application, many factors influence the outcome of the actual text within the form. All these factors must be checked in order to ensure a correct printout: 1) The language version of the form used to produce the printout. Example: If you want to print a French invoice, you need to have a FR version of your SAPscript or SmartForms invoice form RVINVOICE01. And the application program must specify the corresponding language key (FR) when calling the SAPscript or SmartForms API. 2) The font selections specified in the form (possibly also in a SAPscript style or SmartStyle used in a form). Example: In a SAPscript form or a SmartStyle you need to specify HELVE if you want to print German text in Helvetica (or similar) font. If you want to print Japanese text, HELVE is not a valid choice but you need to specify a Japanese font like JPMINCHO in your Japanese form. 3) The output character set of the device type Every printer in transaction SPAD has a "device type" assigned. Device types used by the spooler for printing support only one single specific output character set. All text from the form has to be converted (using SAP's built-in character conversion mechanism) to this output character set. A character set can typically support either a single language (e.g. Shift-JIS which supports only Japanese) or a set of languages (e.g. ISO 8859-1, which supports Western-European languages). It is possible that a given language (such as German) can be supported by several output character sets, e.g. you may use either ISO 8895-1 (Latin-1) or ISO 8859-2 (Latin-2) to represent German text. This is so because both character sets contain the special characters used in German. Example: HPLJ4000 is a HP LaserJet device type supporting the ISO 8859-1 (Latin-1) character set. ISO 8859-1 can be used to represent e.g. Dutch, English, French, German, Spanish, Swedish but NOT Russian or Japanese. As a consequence, it is ok to use HPLJ4000 to print English, German French etc. but not for Japanese or Russian. 4) The set of available printer fonts for a given device type When formatting a document, SAPscript and SmartForms perform an automatic mapping of the font definitions in the form (e.g. "HELVE 14 point bold") and the available printer fonts of the device type. A replacement printer

description

apnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

Transcript of Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

Page 1: Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

08.01.2007 Page 1 of 5

SAP Note Number 776507SAPscript/SmartForms: Which fonts for which languages?

Note Language: English Version: 4 Validity: Valid from 22.08.2005

Summary

SymptomDocuments printed via SAPscript or SmartForms do not print with correctspecial characters, e.g. ### prints instead of Japanese or Russiancharacters. What to do?

More TermsSAPscript, SmartForms, printing, device types, OTF

Cause and PrerequisitesHelp required to choose proper fonts in a SAPscript or SmartForm

SolutionWhen using SAPscript or SmartForms to print (or email or fax) a form from abusiness application, many factors influence the outcome of the actual textwithin the form. All these factors must be checked in order to ensure acorrect printout:

1) The language version of the form used to produce the printout.Example: If you want to print a French invoice, you need to have a FRversion of your SAPscript or SmartForms invoice form RVINVOICE01. And theapplication program must specify the corresponding language key (FR) whencalling the SAPscript or SmartForms API.

2) The font selections specified in the form (possibly also in a SAPscriptstyle or SmartStyle used in a form).Example: In a SAPscript form or a SmartStyle you need to specify HELVE ifyou want to print German text in Helvetica (or similar) font. If you wantto print Japanese text, HELVE is not a valid choice but you need to specifya Japanese font like JPMINCHO in your Japanese form.

3) The output character set of the device typeEvery printer in transaction SPAD has a "device type" assigned. Devicetypes used by the spooler for printing support only one single specificoutput character set. All text from the form has to be converted (usingSAP's built-in character conversion mechanism) to this output characterset.A character set can typically support either a single language (e.g.Shift-JIS which supports only Japanese) or a set of languages (e.g. ISO8859-1, which supports Western-European languages). It is possible that agiven language (such as German) can be supported by several outputcharacter sets, e.g. you may use either ISO 8895-1 (Latin-1) or ISO 8859-2(Latin-2) to represent German text. This is so because both character setscontain the special characters used in German.Example: HPLJ4000 is a HP LaserJet device type supporting the ISO 8859-1(Latin-1) character set. ISO 8859-1 can be used to represent e.g. Dutch,English, French, German, Spanish, Swedish but NOT Russian or Japanese.As a consequence, it is ok to use HPLJ4000 to print English, German Frenchetc. but not for Japanese or Russian.

4) The set of available printer fonts for a given device typeWhen formatting a document, SAPscript and SmartForms perform an automaticmapping of the font definitions in the form (e.g. "HELVE 14 point bold")and the available printer fonts of the device type. A replacement printer

Page 2: Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

08.01.2007 Page 2 of 5

SAP Note Number 776507SAPscript/SmartForms: Which fonts for which languages?

font is chosen, should the specified font selection not be available in thedevice type. Now this replacement can be problematic if a language-specificfont, such as Chinese CNSONG, is specified in a form and it gets replacedby a font which does not support this language, e.g. COURIER.To solve this problem, font families in SE73 have language attributeassigned, e.g. some fonts are characterized as being suitable only forcertain languages. And when a replacement has to be chosen because theoriginal font from the form is not available in the device type, areplacement font is chosen which has the same language attributes.If no fonts for the language in question exist in the device type, theresulting font will not be able to print the special characters and youwill see "wrong" output characters in the printout.

Note on SAPscript/SmartForms Print Preview:The OTF Print Preview available in Windows GUI (e.g. from transaction SP01)will sometimes not show the "wrong" characters which appear on the finalprintout. Here is the reason: since the Print Preview runs in Windowsenvironment, it will use Windows fonts to represent the actual printerfonts. A Windows font typically has more available characters (i.e. coversmore character sets) than are actually available in a printer's residentfont.A typical example where the Print Preview will differ from the printout ishere: if you have a Chinese PCL5 printer such as CNHPLJ4 and use theWestern Latin font COURIER in your document, the print preview will showyou Chinese characters if you (by accident) tried to format Chinesecharacters in COURIER font. This is because Windows will automaticallychoose a font that can output Chinese characters (which is actually notCourier). But when you print the job on an actual PCL5 printer withresident Western and Chinese fonts, the Courier font will not print anyChinese characters but Western special characters instead, because theprinter's resident Courier font does not include Chinese characters.Rule of thumb: all Asian device types (e.g. CNHPLJ4, JPHPLJ4, JPPOST,KPHPLJ4) support not only Asian fonts but also COURIER, HELVE and TIMESfonts. But these Latin fonts can only be used to print English text, notChinese/Japanese/Korean characters.

Which fonts are suitable for a given language?Language(s): Font family to use in a form:************* Latin-1 (Western Europe/Americas) *******DE,EN,FR,ES,NL,SV COURIER, HELVE, TIMES (LETGOTH, LNPRINT)

************* Latin-2 (Central Europe) ****************PL, CZ COURIER, HELVE, TIMES

************* ISO 8859-4 (Baltic) *********************ET, LT, LV COURIER, HELVE, TIMES

************* ISO 8859-5 (Cyrillic) *******************BG, RU, SR, UK COURCYR, HELVCYR, TIMECYR

************* ISO 8859-7 (Greek) **********************EL COUR_I7, HELV_I7, TIME_I7

************* ISO 8859-8 (Hebrew) *********************HE COURIER, HELVE, TIMES

Page 3: Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

08.01.2007 Page 3 of 5

SAP Note Number 776507SAPscript/SmartForms: Which fonts for which languages?

************* ISO 8859-9 (Turkish) ********************TR COURIER, HELVE, TIMES

************* Simplified Chinese **********************ZH CNHEI, CNKAI, CNSONG

************* Japanese ********************************JA JPMINCHO, DBMINCHO, DBGOTHIC

************* Korean **********************************KP KPBATANG, KPDODUM, KPGULIM KPGUNGSE, KPSAMMUL

************* Traditional Chinese *********************ZF TWDPHEI, TWMING, TWSONG

************* Thai ************************************TH THANGSAN, THDRAFT, THVIJIT

************* Arabic (Unicode systems only) ***********AR ANDALE_J

Verify your output by examining the OTF dataWhen analysing printing problems of this type, be sure to check the OTFdata which gets produced by SAPscript or SmartForms. OTF or "Output TextFormat" is the intermediate page-description format generated fromSAPscript or SmartForms. OTF will contain the final printer font names andcharacter set/language identifiers which help to solve the problem. OTFwill even name the form and the language of the form used to create theoutput.The easiest way to do this is to create a spool request from yourapplication, run transaction SP01, use menuGoto->Display Requests->Settingsand chooseDisplay Mode: RawNow display your spool request. If this is a SAPscript or SmartForms spoolrequest, you will see OTF data. Each line represents one OTF command, everycommand starts with a 2-character cmd identifier and possibly some cmdparameters follow.

Here is an excerpt from a sample OTF file where we highlight the mostinteresting commands://XHPLJ8000 0700 00000+00000+1IN04EALEXTEST_ZEBRAIN05%PAGE1OPDINA4 P 144 240 1683811906000010000100001IN06%WINDOW2MT0024401289CP11000000EFCHELVE 120 00109XSF100SF101110000067E XUL +0000000000000SW00067CT00000000ST0453037Dieses SF hat Stil ALEXTEST_ZEBRA mit...The 1st line with the // (Control) command reveals the device type used to

Page 4: Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

08.01.2007 Page 4 of 5

SAP Note Number 776507SAPscript/SmartForms: Which fonts for which languages?

print: HPLJ8000//XHPLJ8000 0700 00000+00000+1

The 2nd line (IN = Info command) shows the name and (internal 1-char)language key of the form:IN04EALEXTEST_ZEBRAIn this case it is the English (E = EN) SmartForm ALEXTEST_ZEBRA

The OP-line (OP = Open Page) gives the page format used in the form, it isDINA4 Portrait orientation:OPDINA4 P 144 240 1683811906000010000100001

The CP (CodePage) cmd shows the SAP system codepage used to code the textand the active language. In our case it is codepage 1100 and language E =EN = English.CP11000000E

Finally, the FC-cmd (Font Call) lists a printer font selected withinSmartForms. Please note that every SmartForm has a designated defaultSmartStyle under "Form Attributes->Output Options". In addition, every textnode can have a SmartStyle attached (which will override the definitionsfrom the default style for the text). In our case the resulting printerfont that was selected is HELVE 12.0 pt bold-off, italic-off.FCHELVE 120 00109XSF100SF101110000067E X

Header Data

Release Status: Released for CustomerReleased on: 22.08.2005 09:57:20Priority: Recommendations/additional infoCategory: Customizing

Main Component BC-CCM-PRN Print and Output ManagementAdditional Components:

BC-SRV-SCR SAPscript

BC-SRV-SSF Smart Forms

The Note is release-independent

Related Notes

Page 5: Sapnote-Note 77650SAPscript-SmartForms7 - SAPscript-SmartForms Which Fonts for Which Languages

08.01.2007 Page 5 of 5

SAP Note Number 776507SAPscript/SmartForms: Which fonts for which languages?

Number Short Text

880490 Russian Sapscript forms print with wrong characters

423003 Printers and Asian/Eastern European fonts/languages

Attributes

Attribute Value

weitere Komponenten 0000033637

weitere Komponenten BC-SRV-SCR