Closed
Bug 55021
Opened 25 years ago
Closed 24 years ago
RFE: Korean and Chinese fonts definitions for PostScript printing
Categories
(Core :: Printing: Output, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: masaki.katakai, Assigned: bstell)
References
Details
(Keywords: intl)
Attachments
(9 files)
|
5.58 KB,
patch
|
Details | Diff | Splinter Review | |
|
8.50 KB,
patch
|
Details | Diff | Splinter Review | |
|
7.70 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.14 KB,
text/plain
|
Details | |
|
1.25 KB,
text/plain
|
Details | |
|
8.39 KB,
patch
|
Details | Diff | Splinter Review | |
|
9.19 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.04 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.22 KB,
patch
|
Details | Diff | Splinter Review |
unix.js has now only japanese font definition for UNIX postscript printing.
// ps font
pref("print.psnativecode.ja", "euc-jp");
pref("print.psnativefont.ja", "Ryumin-Light-EUC-H");
We need to define Korean and Chinese fonts. I understand that PostScript
printers are not popular in Korea and China, also there is no standard
font name of PostScript for thoese locales, however, it would be better
we define *widely-used* fonts.
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → Future
| Reporter | ||
Comment 1•25 years ago
|
||
Munhwa font can be used for ko locale,
pref("print.psnativecode.ko", "euc-kr);
pref("print.psnativefont.ko", "Munhwa-Regular-KSC-EUC-H");
Comment 2•25 years ago
|
||
I don't know much about this.. do you know who could do this Frank?
Assignee: dcone → ftang
Status: ASSIGNED → NEW
| Reporter | ||
Comment 3•25 years ago
|
||
Frank,
I'd like to take this. If you agree, please assign to tajima@eng.sun.com.
Hi, Erik:
Do we have resource in the group to fix this bug? If none, should we reassign to
Tajima-san?
Comment 5•24 years ago
|
||
Added teruko & ji and sending this to ji for QA for Chinese.
Will see about Korean later.
When you add PS font names, please also add the following
for Lexmark PS fonts. (Too bad we don't have generic
names for these.)
Simplified Chinese:
CFangSong-Light
MHei-Bold
MKai-Medium
MSung-Light
Traditional Chinese:
MKai-Medium
MingMT-Light
MingMTP-Light
QA Contact: shrir → ji
| Reporter | ||
Comment 6•24 years ago
|
||
Can anyone check fontname in ghostscript in Linux
of major chinese distributions?
| Reporter | ||
Comment 7•24 years ago
|
||
Here is an example for korean and chinese locale in Solaris DPS.
user_pref("print.psnativecode.zh-CN", "gb2312");
user_pref("print.psnativefont.zh-CN", "Song-Medium-EUC");
user_pref("print.psnativecode.zh-TW", "big5");
user_pref("print.psnativefont.zh-TW", "Ming-Light-B5");
user_pref("print.psnativecode.ko", "euc-kr");
user_pref("print.psnativefont.ko", "Myeongjo-Medium-EUC");
We should define more popular fonts in unix.js for Mozilla.
The fonts should be available on Linux ghostview for those
locales.
Comment 8•24 years ago
|
||
Reassign to Katakai san.
Please contact i18n group if you need help (e.g. code review, cvs checkin).
Assignee: ftang → katakai
Comment 10•24 years ago
|
||
Can anyone test Katakai's patch ? Does anyone have testing environment which can
verify the fix ?
Comment 11•24 years ago
|
||
We should be able to. In addition to Japanese, we have
Trad. & Simplified Chinese and Korean printing capability.
| Reporter | ||
Comment 12•24 years ago
|
||
I got a info that Ming-Light-H is more popular than -Big5 font for zh-TW.
user_pref("print.psnativefont.zh-TW", "Ming-Light-H");
user_pref("print.psnativecode.zh-TW", "x-euc-tw");
| Assignee | ||
Comment 13•24 years ago
|
||
I found this:
http://picard.tamu.edu/doc/gs/Fonts.htm
| Assignee | ||
Comment 14•24 years ago
|
||
Katakai,
Do we know which printers (or ghostscript) support these fonts:
// ps font
pref("print.psnativecode.ja", "euc-jp");
pref("print.psnativefont.ja", "Ryumin-Light-EUC-H");
user_pref("print.psnativecode.ko", "euc-kr");
user_pref("print.psnativefont.ko", "Myeongjo-Medium-EUC");
user_pref("print.psnativecode.zh-CN", "gb2312");
user_pref("print.psnativefont.zh-CN", "Song-Medium-EUC");
user_pref("print.psnativefont.zh-TW", "Ming-Light-H");
user_pref("print.psnativecode.zh-TW", "x-euc-tw");
| Assignee | ||
Comment 15•24 years ago
|
||
I'd like to propose the following:
1) we implement the ps font names suggested by sun.
2) we open a new bug to have the code look for a per-printer "ps font name
override" file and if found use the names in this file.
The file would allow for multiple printers.
Printer vendors could supply a file with the font names in their printer on the
web. Users would copy it down, move it to a particular directory and then
rename it. Mozilla would then use the file for that printer.
This would provide a relatively simple mechanism for users to setup
| Reporter | ||
Comment 16•24 years ago
|
||
Hi Brian,
the examples are for Solaris Display PostScript system and
would not work properly on exact printers. We should define
more popular fontnames in Mozilla, which are used in ghostscript.
I have got info from Korean and the following is most popular
font,
pref("print.psnativecode.ko", "euc-kr);
pref("print.psnativefont.ko", "Munhwa-Regular-KSC-EUC-H");
Japanese font is OK. I'd like to ask chinese folks to find
popular fonts in Chinese Linux distributions.
| Assignee | ||
Comment 17•24 years ago
|
||
If we use a per-printer override file I'm not sure if it should be pref based or
properties based.
This kind of data looks like a property but the existing code is pref based.
If pref then might want to call GetFilePref()
If property then might want to call nsURLProperties::Get()
(look for gInfo->Get in nsUNIXCharset.cpp)
| Assignee | ||
Comment 18•24 years ago
|
||
this Lexmark page indicated they emulate mswindows fonts
http://www.lexmark.com/printers/fontdimms.html
Simplified Chinese Font Names p/n 13K0215
For PostScript 3 For PCL 6
CFangSong-Light CFangSongGB
MHei-Bold MHeiGB
MKai-Medium MKaiGB
MSung-Light MSungGB
Traditional Chinese Font Names p/n 13K0216
For PostScript 3 For PCL 6
MKai-Medium MKai
MingMT-Light MingMT
MingMTP-Light MingMTP
| Assignee | ||
Comment 19•24 years ago
|
||
I looked at the ps printing code. If the user printed to a file they would
expect to be able to then send that file to the printer. In doing this the code
would not see the printer name and hence would not have been able to look in the
per-printer override file. Thus I think we should not do a per-printer override
but just do a single override file.
| Assignee | ||
Comment 20•24 years ago
|
||
Here is a sample file (unixpsfonts.properties) for Lexmark:
# ps font mapping for Lexmark printer with a
# Simplified Chinese font DIMM
# Traditional Chinese font DIMM
# Japanese font DIMM
psnativecode.ja=euc-jp
psnativefont.ja= HG-MinchoL
#psnativecode.ko=euc-kr
#psnativefont.ko=
psnativecode.zh-CN=gb2312
psnativefont.zh-CN=CFangSong-Light
psnativefont.zh-TW=MKai-Medium
psnativecode.zh-TW=x-euc-tw
Comment 21•24 years ago
|
||
For Wangsun (precomposing) encoding on Lexmark printer with
Korean PS fonts.
MD_Batang
MD_BatangChe
MD_Dodum
MD_DodumChe
MD_Gulim
MD_GulimChe
MD_Gungseo
MD_GungseoChe
For Johab encoding, add "_nt" to the end.
MD_Batang_nt
MD_BatangChe_nt
MD_Dodum_nt
MD_DodumChe_nt
MD_Gulim_nt
MD_GulimChe_nt
MD_Gungseo_nt
MD_GungseoChe_nt
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•24 years ago
|
Target Milestone: Future → mozilla0.8
| Assignee | ||
Comment 23•24 years ago
|
||
| Assignee | ||
Comment 24•24 years ago
|
||
Here is a working entry for a Lexmark Japanese fontdimm
(note the font name is "HG-MinchoL-EUC-H" not "HG-MinchoL")
##
# ps font mapping for Lexmark printer with a
#
# Japanese font DIMM
print.psnativecode.ja=euc-jp
print.psnativefont.ja=HG-MinchoL-EUC-H
#print.psnativefont.ja=HG-GothicB-EUC-H
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.8 → mozilla0.9
| Assignee | ||
Comment 26•24 years ago
|
||
| Assignee | ||
Comment 27•24 years ago
|
||
here is a working sample for Lexmark Optra 610:
(korean does not work yet)
# ps font mapping for Lexmark printer with a
#
# Japanese font DIMM
print.psnativefont.ja=HG-MinchoL-EUC-H
print.psnativecode.ja=euc-jp
#
# Korean font DIMM
print.psnativefont.ko=MD_Batang-KSC-EUC-H
print.psnativecode.ko=EUC-KR
#
# Simplified Chinese font DIMM
print.psnativefont.zh-CN=CFangSong-Light-GB-EUC-H
print.psnativecode.zh-CN=gb2312
#
# Traditional Chinese font DIMM
print.psnativefont.zh-TW=MingMT-Light-B5-H
print.psnativecode.zh-TW=big5
| Assignee | ||
Comment 28•24 years ago
|
||
Katakai-san,
Would you:
apply the patches
build
cd $TOP/mozilla/dist/bin/res/
cp sample.unixpsfonts.properties unixpsfonts.properties
edit the unixpsfonts.properties for the ja/tw/cn/ko postscript fonts you
have
and try printing?
thanks
Comment 29•24 years ago
|
||
PS printers with Korean PS fonts are extremly rare even in Korea.
I was surprised to find that Lexmark has the DIMM for Korean PS fonts.
Anyway, if we can restrict (I guess we can't) ourselves to supporting
Linux only, Munhwa-Regular (I gave last year to ould be a lot better for
Korean than one for Lexmark or Sun's DPS. However, the situation might
change as a couple of patches to support truetype fonts in ghostscript
6.5 have been around for a while (one from Korean and the other from
Japan) and there are some truetype fonts with pseudo-standardized
names like Batang, Gulim, Dotum available for Linux/FreeBSD. I really
hate these names (which are the established standard under MS-Windows)
because it's all but impossible to tell what style of fonts - serif or
sans-serif - these are from their names.)
| Assignee | ||
Comment 30•24 years ago
|
||
The corrected Korean spec for a Lexmark printer is:
#
# Korean font DIMM
print.psnativefont.ko=MD_Batang
print.psnativecode.ko=EUC-KR
| Assignee | ||
Comment 31•24 years ago
|
||
added jshin@pantheon.yale.edu to cc:
| Assignee | ||
Comment 32•24 years ago
|
||
The release notes should look something like this:
To configure Netscape/Mozilla postscript printing get the font info file
from the vendor and copy it to
$MOZILLA_FIVE_HOME/defaults/prefs/unixpsfonts.properties
and restart Netscape/Mozilla.
| Assignee | ||
Comment 33•24 years ago
|
||
I changed the FREE_IF macro in nsPostScriptObj.cpp to:
#define FREE_IF(x) do {if(x) {nsMemory::Free(x); (x)=nsnull;}} while(0)
this makes the semi-colon in the typical usage "FREE_IF(ptr);" associate with
the macro instead of being a separate statement.
| Reporter | ||
Comment 34•24 years ago
|
||
I've verified Brian's patch works well in the following conditions,
- user's prefs.js and unixpsfonts.properties both exist
- only unixpsfonts.properties exist
- only user's prefs.js exist
- both prefs.js and unixpsfonts.properties does not exist
Btw, Brian, you mentioned about the locale of unixpsfonts.properties
in your comment of 2001-02-19 but I believe defaults/prefs is not correct,
res/ is correct location, right?
| Assignee | ||
Comment 35•24 years ago
|
||
| Assignee | ||
Comment 36•24 years ago
|
||
| Assignee | ||
Comment 37•24 years ago
|
||
| Assignee | ||
Comment 38•24 years ago
|
||
yes, Katakai-san, /res is correct.
The release notes should look something like this:
To configure Netscape/Mozilla postscript printing get the font
info file from the vendor and copy it to:
$MOZILLA_FIVE_HOME/res/unixpsfonts.properties
and restart Netscape/Mozilla. A sample version of
this file is supplied to simplify the the process
of creating a new version:
$MOZILLA_FIVE_HOME/res/sample.unixpsfonts.properties
| Assignee | ||
Comment 39•24 years ago
|
||
dcone: can you review the patch?
http://bugzilla.mozilla.org/show_bug.cgi?id=61108
thanks
| Assignee | ||
Comment 40•24 years ago
|
||
Don, I meant this attachment:
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=26276
Comment 41•24 years ago
|
||
The code looks good. Make sure you run printing tests with the samples and a
few top 100 sites.
One question: the following line..
#define FREE_IF(x) do {if(x) {nsMemory::Free(x); (x)=nsnull;}} while(0)
would
#define FREE_IF(x) {if(x) {nsMemory::Free(x); (x)=nsnull;}}
be simplier or is there a reason for the do{}while loop I am missing..
r=dcone
| Assignee | ||
Comment 42•24 years ago
|
||
I struggled with the "do {} while(0)" as well.
The "do {} while(0)" is slightly different from "{}".
Consider a typical usage:
FREE_IF(p);
The "{if(x) {...}}" version gets translated as:
{if(x) {...}};
which equals:
{
if(x) {
...
}
}
;
Note tht the ";" becomes a separate statement from the "{if(x) {...}}".
By adding the "do {} while(0)" the semi-colon gets associated with the macro
instead of being a separate "statement".
This "do {} while(0)" shows up in other similar macros; eg:
http://lxr.mozilla.org/seamonkey/source/include/xp_mem.h#37
36 /* global free routine */
37 #define XP_FREEIF(obj) do { if(obj) { XP_FREE(obj); obj = 0; }} while(0)
for more examples see:
http://lxr.mozilla.org/seamonkey/search?string=while%280%29
| Assignee | ||
Comment 43•24 years ago
|
||
Here is an example of a place where the "do {} while(0)" would be required:
if (condition)
FREE_IF(p);
else
other_statement;
Without the "do {} while(0)" this would not compile.
Comment 44•24 years ago
|
||
do{ and }while(0) are codified and de-uglified by PR_BEGIN_MACRO and
PR_END_MACRO, from prtypes.h, and have been for almost six years. Please use
them even if it makes the macro body multi-line, just to inform others of their
existence and spread the meme.
Lack of nsCOMPtr makes for leak on error here:
+ NS_ENSURE_SUCCESS(nsComponentManager::CreateInstance(
+ NS_PERSISTENTPROPERTIES_CONTRACTID, nsnull,
+ NS_GET_IID(nsIPersistentProperties), (void**)&printerprops_tmp),
+ PR_FALSE);
+ NS_ENSURE_SUCCESS(printerprops_tmp->Load(in), PR_FALSE);
+ gPrinterProps = printerprops_tmp;
If the load fails, printerprops_tmp is not released. Use an nsCOMPtr locally,
or (better, not sure you can do this on all platforms -- dbaron?) just make
gPrinterProps a static nsCOMPtr.
These should be nsAutoStrings, no?
+ nsString key;
+ key.AssignWithConversion(aKey.GetBuffer());
+ nsString oValue;
These (and psnativefont, I think) really should be nsXPIDLCStrings, and then you
don't need the FREE_IF macro, and the FREE_IF calls on every exit path from the
function:
char *psnativecode = nsnull;
char *psunicodefont = nsnull;
How about a patch that uses these XPCOM auto-helper classes?
/be
I'm not a big fan of static nsCOMPtrs -- they've been known to cause shutdown
problems when they release something after XPCOM shutdown after things needed to
release them are already shut down, although that's not a problem if you can
guarantee that they're set to null before or during XPCOM shutdown (even if
something else leaks). If they're global scope, they also (I think) cause
problems on OpenBSD, and if they're function scope they cause problems with gcc
if we try to unload the shared library they're in before exit (unless we use
-fuse-cxa-atexit, which would force users to use a reasonably (?) recent glibc).
| Assignee | ||
Comment 46•24 years ago
|
||
| Assignee | ||
Comment 47•24 years ago
|
||
the attachement comment above should read:
revised patches to nsPostScriptObj.h, nsPostScriptObj.cpp, and
gfx/src/ps/Makefile.in
Use of the very cool nsXPIDLCStrings removed the need for the FREE_IF macro
(thanks Brendan) and thus no need for the (cool) PR_BEGIN_MACRO and
PR_END_MACRO.
Used a nsCOMPtr with NS_ENSURE_SUCCESS to avoid leak (thanks Brendan).
Modified the pref/enum callback to take the nsPostScriptObj object and thus
removed the need for a global gPrinterProps. Added printer props to the
nsPostScriptObj (using nsCOMPtr).
| Assignee | ||
Comment 48•24 years ago
|
||
Comment 49•24 years ago
|
||
r=ftang
Comment 50•24 years ago
|
||
Please use consistent upper/lowercasing for the method names.
Please consider removing the empty prefs in unix.js.
sr=erik@netscape.com
| Reporter | ||
Comment 51•24 years ago
|
||
Brian,
It seems that the changes have been checked in to Trunk, but I found
it does not work because we don't have entries in unix.js,
PrefEnumCallback() is called for unix.js so your codes are not called.
We need to check mPrinterProps entries as well.
I'll attach the patch and could you evaluate?
| Reporter | ||
Comment 52•24 years ago
|
||
| Assignee | ||
Comment 53•24 years ago
|
||
we need a way to enumerate the language groups so we can tell the postscript
the font mappings.
| Assignee | ||
Comment 54•24 years ago
|
||
Comment 55•24 years ago
|
||
r=ftang
Comment 56•24 years ago
|
||
| Assignee | ||
Comment 57•24 years ago
|
||
should be working now
Except for Japanese international text will require a vendor font file such as
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=26278
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 58•24 years ago
|
||
QA contact to Yuying, since she is looking into this area now.
QA Contact: ji → ylong
Comment 59•24 years ago
|
||
I can not get the right print out on Chinese and Korean pages, even Japanese
pages are display fine. Re-open this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 60•24 years ago
|
||
we need to document how to enable intl printing; see bug 76433
Comment 61•24 years ago
|
||
The problem was Chinese and Korean don't have common font that works on e.g.
Lexmark printer, but Japanese does has some common font. That's why Japanese
was displayed OK and Chinese / Korean were not.
After I copy the file that Brain's attached on 02/27/01 09:00, Chinese and
Korean now works fine. I'll mark this bug as fixed.
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•