|
|
Home » Developing U++ » U++ Developers corner » CJK woes
CJK woes [message #7639] |
Fri, 12 January 2007 03:36 |
mobilehunter
Messages: 87 Registered: November 2006
|
Member |
|
|
I just try the UWord with some japanese text,
but when i export it to PDF, then open it but no japanese character showed, only boxes.
Do you guys know how to get proper result?
Thanks
[Updated on: Mon, 22 January 2007 00:22] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: Howto export japanese word to pdf? [message #7662 is a reply to message #7660] |
Sat, 13 January 2007 09:16 |
|
mirek
Messages: 14112 Registered: November 2005
|
Ultimate Member |
|
|
mobilehunter wrote on Fri, 12 January 2007 19:50 |
luzr wrote on Sat, 13 January 2007 01:20 | Interesting, if I load text into UWord, I see boxes.
Looks like some weird font problem. What font is used? Is this font different from normal English XP?
Mirek
|
Ah forgot to say. First i tried UWord from office computer with normal English XP(but able to show japanese characters), and the problem appeared. Then i tried at home with pure japanese, still have the problem.
|
Hm, could be that, now thinking about it, I do not have raw English version, but east-european...
Quote: |
If you mean font from UWord, i didn't use any special font.
My uword just has Arial and En-US.
How to find out which font i use?
|
Arial then
Quote: |
Btw can you see japanese character from a japanese website?
Thanks
|
I think I can. Any website to test?
Somebody with English XP, could you test whether you see japanesse in UWord?
Mirek
|
|
|
|
|
|
|
Re: Howto export japanese word to pdf? [message #7670 is a reply to message #7669] |
Sun, 14 January 2007 02:06 |
mobilehunter
Messages: 87 Registered: November 2006
|
Member |
|
|
luzr wrote on Sun, 14 January 2007 07:43 | No, I cannot - I do not have appropriate keyboard methods installed, and even if I would, I do not know how to use it...
For now, I would concentrate on fact that you can save and load the file, see japanesse, but I do not....
Mirek
|
Hope this link setup japanese font help.
From the link, one of the font used is MSPMincho.
But thanks anyway.
[Updated on: Sun, 14 January 2007 02:25] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Howto export japanese word to pdf? [message #7765 is a reply to message #7764] |
Sun, 21 January 2007 09:20 |
|
mirek
Messages: 14112 Registered: November 2005
|
Ultimate Member |
|
|
Quote: |
Then i changed DrawText.cpp, GetPage function.
ptr->GetMetrics(page, ptr->default_width);
//ptr->GetMetrics(140, ptr->default_width);
/*for(int i = 0; i < 256; i++)
if(ptr->default_width[i].width) {
for(int j = 0; j < 256; j++)
ptr->default_width[j] = ptr->default_width[i];
break;
}*/
I don`t know my changes will break everything, but the result is better.
|
Well, the purpose of that code is to save the space needed for character widths for CJK fonts (as all glyphs seem to be monospaced).
Unfortunately, the code was designed for chinesse glyphs (tries to read specific characters starting at unicode 140*256) and very likely these characters are missing in PMincho.
BTW, it is also interesting that widths are correct when the font is accessed as Arial - most likely in that case, some other font is used there to provide chinesse chars.
Anyway, I guess we should try to fix this for PMincho as well. What we need to have there is the correct monospaced width of CJK glyph. Any ideas?
Can you check whether width is gound (break is taken)?
Thinking about it, perhaps we should simply check the first 'page' used instead of 140:
FontInfo::CharMetrics *FontInfo::GetPage(int page) const
{
if(page >= 46 && !ptr->default_width) {
ptr->default_width = new CharMetrics[256];
ptr->GetMetrics(page, ptr->default_width);
for(int i = 0; i < 256; i++)
if(ptr->default_width[i].width) {
for(int j = 0; j < 256; j++)
ptr->default_width[j] = ptr->default_width[i];
break;
}
}
CharMetrics *& cm = ptr->width[page];
if(!cm) {
cm = new CharMetrics[256];
ptr->GetMetrics(page, cm);
if(page == 1)
ComposeMetrics(ptr->font, cm);
if(page >= 46) {
for(int i = 0; i < 256; i++) {
if(!(cm[i] == ptr->default_width[i]) && cm[i].width)
return cm;
}
delete[] cm;
cm = ptr->default_width;
}
}
return cm;
}
Can you check please?
Mirek
[Updated on: Sun, 21 January 2007 09:37] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun Nov 10 21:01:39 CET 2024
Total time taken to generate the page: 0.00676 seconds
|
|
|