[xwiki-users] PDF export, chinese characters displayed as #, XE3.2
Hi, I tried to export a page with many chinese characters as pdf, but the resulted pdf has many "#". There are no encoding problems elsewhere, everything is displayed correctly by setting utf8 encoding everywhere (xwiki.cfg, database, tomcat). I tried to search http://jira.xwiki.org and got no luck... -- Thanks for reading! Yang Li Electronic Engineering, Fudan University
# means that the font used in the pdf does not contain those characters. You should find a font that has support for Chinese, copy it in WEB-INF/fonts, extract xhtml2fo.xsl from WEB-INF/libs/xwiki-platform-legacy-oldcore-*.jar into WEB-INF/classes, edit it and add the name of your font next to FreeSerif and FreeMono wherever they occur in the file, for example: <xsl:attribute name="font-family">FreeSerif,IPAGothic,serif</xsl:attribute> Restart the server, and everything should work. A good free font is IPAGothic, which I'll have to check if it can be redistributed by default. Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-28 9:56 PM, "yang Li" <[email protected]> wrote:
Hi,
I tried to export a page with many chinese characters as pdf, but the resulted pdf has many "#".
There are no encoding problems elsewhere, everything is displayed correctly by setting utf8 encoding everywhere (xwiki.cfg, database, tomcat).
I tried to search http://jira.xwiki.org and got no luck...
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
It still doesn't work :( I tried Adobe's AdobeSongStd-Light.otf, and simsum.ttc, STSONG.TTF from my windows, and did the xhtml2fo.xsl job and restart the tomcat but still get millions of ####... 2011/10/30 Sergiu Dumitriu <[email protected]>
# means that the font used in the pdf does not contain those characters. You should find a font that has support for Chinese, copy it in WEB-INF/fonts, extract xhtml2fo.xsl from WEB-INF/libs/xwiki-platform-legacy-oldcore-*.jar into WEB-INF/classes, edit it and add the name of your font next to FreeSerif and FreeMono wherever they occur in the file, for example:
<xsl:attribute name="font-family">FreeSerif,IPAGothic,serif</xsl:attribute>
Restart the server, and everything should work.
A good free font is IPAGothic, which I'll have to check if it can be redistributed by default.
Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-28 9:56 PM, "yang Li" <[email protected]> wrote:
Hi,
I tried to export a page with many chinese characters as pdf, but the resulted pdf has many "#".
There are no encoding problems elsewhere, everything is displayed correctly by setting utf8 encoding everywhere (xwiki.cfg, database, tomcat).
I tried to search http://jira.xwiki.org and got no luck...
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thanks for reading! Yang Li Electronic Engineering, Fudan University
Here is part of the logs, seems not found the fonts I placed in the fonts directory... format=pdf&pdfcover=1&pdfcover=0&pdftoc=1&pdftoc=0&comments=0&attachments=0] WARN o.a.f.a.FOUserAgent - Glyph "ι" (0x91cd) not available in font "FreeSerif". 2011/10/30 yang Li <[email protected]>
It still doesn't work :(
I tried Adobe's AdobeSongStd-Light.otf, and simsum.ttc, STSONG.TTF from my windows, and did the xhtml2fo.xsl job and restart the tomcat but still get millions of ####...
2011/10/30 Sergiu Dumitriu <[email protected]>
# means that the font used in the pdf does not contain those characters. You should find a font that has support for Chinese, copy it in WEB-INF/fonts, extract xhtml2fo.xsl from WEB-INF/libs/xwiki-platform-legacy-oldcore-*.jar into WEB-INF/classes, edit it and add the name of your font next to FreeSerif and FreeMono wherever they occur in the file, for example:
<xsl:attribute name="font-family">FreeSerif,IPAGothic,serif</xsl:attribute>
Restart the server, and everything should work.
A good free font is IPAGothic, which I'll have to check if it can be redistributed by default.
Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-28 9:56 PM, "yang Li" <[email protected]> wrote:
Hi,
I tried to export a page with many chinese characters as pdf, but the resulted pdf has many "#".
There are no encoding problems elsewhere, everything is displayed correctly by setting utf8 encoding everywhere (xwiki.cfg, database, tomcat).
I tried to search http://jira.xwiki.org and got no luck...
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University
-- Thanks for reading! Yang Li Electronic Engineering, Fudan University
otf fonts are not supported by FOP, only ttf. A good font that you could use in your instance, but which can't be distributed by XWiki, is Arial Unicode MS, distributed by Microsoft with some of their products. In xhtml2fo you're supposed to write the name (human friendly) of the font, not the name of the file. One other problem I noticed is that text in italics will only try to use the FreeSerif font, since the request for an italic font seems to be stronger than the request for the presence of a certain character. A workaround is to only enable one font on the root element, the one that provides proper support for Chinese. The downside is that English text will also be displayed in that font face, which personally I find less beautiful than FreeSerif. A proper solution would be to use a font that does support bold and italic. Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-29 8:05 PM, "yang Li" <[email protected]> wrote:
It still doesn't work :(
I tried Adobe's AdobeSongStd-Light.otf, and simsum.ttc, STSONG.TTF from my windows, and did the xhtml2fo.xsl job and restart the tomcat but still get millions of ####...
2011/10/30 Sergiu Dumitriu <[email protected]>
# means that the font used in the pdf does not contain those characters. You should find a font that has support for Chinese, copy it in WEB-INF/fonts, extract xhtml2fo.xsl from WEB-INF/libs/xwiki-platform-legacy-oldcore-*.jar into WEB-INF/classes, edit it and add the name of your font next to FreeSerif and FreeMono wherever they occur in the file, for example:
<xsl:attribute name="font-family">FreeSerif,IPAGothic,serif</xsl:attribute>
Restart the server, and everything should work.
A good free font is IPAGothic, which I'll have to check if it can be redistributed by default.
Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-28 9:56 PM, "yang Li" <[email protected]> wrote:
Hi,
I tried to export a page with many chinese characters as pdf, but the resulted pdf has many "#".
There are no encoding problems elsewhere, everything is displayed correctly by setting utf8 encoding everywhere (xwiki.cfg, database, tomcat).
I tried to search http://jira.xwiki.org and got no luck...
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Yes, Arial Unicode MS works. stsong.ttf is also kind of ttf font, but with the font name in Chinese, I tried it without success. Thanks, it is much better now, even though a little bit inaesthetic. P.S. Tables are not displayed quite correctly, some columns lost... δΊ 2011/10/30 10:34, Sergiu Dumitriu ει:
otf fonts are not supported by FOP, only ttf. A good font that you could use in your instance, but which can't be distributed by XWiki, is Arial Unicode MS, distributed by Microsoft with some of their products.
In xhtml2fo you're supposed to write the name (human friendly) of the font, not the name of the file.
One other problem I noticed is that text in italics will only try to use the FreeSerif font, since the request for an italic font seems to be stronger than the request for the presence of a certain character. A workaround is to only enable one font on the root element, the one that provides proper support for Chinese. The downside is that English text will also be displayed in that font face, which personally I find less beautiful than FreeSerif.
A proper solution would be to use a font that does support bold and italic.
Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-29 8:05 PM, "yang Li"<[email protected]> wrote:
It still doesn't work :(
I tried Adobe's AdobeSongStd-Light.otf, and simsum.ttc, STSONG.TTF from my windows, and did the xhtml2fo.xsl job and restart the tomcat but still get millions of ####...
2011/10/30 Sergiu Dumitriu<[email protected]>
# means that the font used in the pdf does not contain those characters. You should find a font that has support for Chinese, copy it in WEB-INF/fonts, extract xhtml2fo.xsl from WEB-INF/libs/xwiki-platform-legacy-oldcore-*.jar into WEB-INF/classes, edit it and add the name of your font next to FreeSerif and FreeMono wherever they occur in the file, for example:
<xsl:attribute name="font-family">FreeSerif,IPAGothic,serif</xsl:attribute> Restart the server, and everything should work.
A good free font is IPAGothic, which I'll have to check if it can be redistributed by default.
Sergiu Dumitriu http://purl.org/net/sergiu/ On 2011-10-28 9:56 PM, "yang Li"<[email protected]> wrote:
Hi,
I tried to export a page with many chinese characters as pdf, but the resulted pdf has many "#".
There are no encoding problems elsewhere, everything is displayed correctly by setting utf8 encoding everywhere (xwiki.cfg, database, tomcat).
I tried to search http://jira.xwiki.org and got no luck...
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thanks for reading!
Yang Li Electronic Engineering, Fudan University _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hey community, I spent some time trying to make PDF export work for CJK (Chinese, Japanese, Korean) characters, and managed to get it working quite well. Searching for some good open source fonts, I finally decided on the following: - CJK Unifonts (Linux re-packaging of the Arphic fonts) - IPAGothic - Baekmuk The first one comes in two variants, serif (a.k.a. ming or song) and script (regular script, kai), and has good support for Chinese, with good, but not complete, support for Japanese, and no support for Korean. It looks very good in both variants, but we should decide on one of them. I uploaded samples on http://jira.xwiki.org/browse/XWIKI-7106 to see how they would look. *** Q1: Should Kai or Ming be used as the default export font for Chinese? *** I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace. The second font, IPAGothic, is centered on Japanese, so it has good support for Japanese, some support for Chinese, and no support for Korean. It is a sans-serif variant. The third font, Baekmuk, brings support for Korean (laking from the other two fonts), along with little support for some Chinese and Japanese characters. This one comes in more variants, but only two are complete enough to be considered, Batang as the serif equivalent, and Gulim as the sans-serif equivalent. *** Q2: Should Batang or Gulim be used for Korean? *** My opinion is that the serif variant looks better on print, although less readable. Still, I've seen Gulim much more often used in practice. I attached two samples for this as well to the Jira issue. *** Q3: Should the current FreeSerif font be used for non-CJK characters, or the font face defined in the font specific to each language? *** While I prefer FreeSerif for all English text, I've seen in practice that the preferred solution is to use a bulkier font for numbers and latin characters. *** Q4: Does italics/oblique make sense for CJK characters? *** The concept of Italics is defined only for latin-like characters, and no font provides support for italics CJK. Still, Firefox does render slanted characters for CJK text inside <em>. FOP, the rendering engine used for generating PDFs, does not have support for automatically slanting fonts that don't provide an italics variant, and will insist on choosing a font that comes in an italics variant. So, this means that by default any text that is emphasized in the wiki will not be displayed in the PDF correctly (they would appear as # characters). There is a simple solution, and that is to alter the font file so that is says that both the regular and italic version of the font are in the file. Another option is to actually provide an oblique version of the font, which FontForge seems to be able to do quickly and with good results. Still, this will double the size of the fonts, so I'd rather not provide italic fonts if they don't actually make much sense for native CJK users. Some other fonts that I looked at were: * the Droid font used in Android devices, which is a sans-serif font IMO not suited for print; its advantage would be that it provides a unitary look for all CJK languages, less good looking, but more legible * the Hanazono font, which has impressive support for all the characters in CJK Unicode sets, but was created in a wiki way, so IMO it's not very consistent throughout the whole spectrum, and not as esthetically looking as the others *** Q5: Should a less good looking, but smaller and more consistent font be used? If yes, which one? *** The Droid font is actually quite small compared to the others, and on smaller font sizes it is more readable. I would really appreciate some feedback on this topic. -- Sergiu Dumitriu http://purl.org/net/sergiu/
? 2011/11/2 10:46, Sergiu Dumitriu ??:
Hey community,
I spent some time trying to make PDF export work for CJK (Chinese, Japanese, Korean) characters, and managed to get it working quite well.
Searching for some good open source fonts, I finally decided on the following:
- CJK Unifonts (Linux re-packaging of the Arphic fonts) - IPAGothic - Baekmuk
The first one comes in two variants, serif (a.k.a. ming or song) and script (regular script, kai), and has good support for Chinese, with good, but not complete, support for Japanese, and no support for Korean. It looks very good in both variants, but we should decide on one of them. I uploaded samples on http://jira.xwiki.org/browse/XWIKI-7106 to see how they would look.
*** Q1: Should Kai or Ming be used as the default export font for Chinese? ***
I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace.
As a Chinese, I strongly recommend *song* , the most poluar font, and we seldom use ming in official documents...
The second font, IPAGothic, is centered on Japanese, so it has good support for Japanese, some support for Chinese, and no support for Korean. It is a sans-serif variant.
The third font, Baekmuk, brings support for Korean (laking from the other two fonts), along with little support for some Chinese and Japanese characters. This one comes in more variants, but only two are complete enough to be considered, Batang as the serif equivalent, and Gulim as the sans-serif equivalent.
*** Q2: Should Batang or Gulim be used for Korean? ***
My opinion is that the serif variant looks better on print, although less readable. Still, I've seen Gulim much more often used in practice. I attached two samples for this as well to the Jira issue.
*** Q3: Should the current FreeSerif font be used for non-CJK characters, or the font face defined in the font specific to each language? ***
While I prefer FreeSerif for all English text, I've seen in practice that the preferred solution is to use a bulkier font for numbers and latin characters. FreeSerif is good.
*** Q4: Does italics/oblique make sense for CJK characters? ***
The concept of Italics is defined only for latin-like characters, and no font provides support for italics CJK. Still, Firefox does render slanted characters for CJK text inside <em>. FOP, the rendering engine used for generating PDFs, does not have support for automatically slanting fonts that don't provide an italics variant, and will insist on choosing a font that comes in an italics variant. So, this means that by default any text that is emphasized in the wiki will not be displayed in the PDF correctly (they would appear as # characters). There is a simple solution, and that is to alter the font file so that is says that both the regular and italic version of the font are in the file. Another option is to actually provide an oblique version of the font, which FontForge seems to be able to do quickly and with good results. Still, this will double the size of the fonts, so I'd rather not provide italic fonts if they don't actually make much sense for native CJK users.
In fact, Chinese people use bold font to emphasize (hei), not italics, and we seldom use italics.
Some other fonts that I looked at were: * the Droid font used in Android devices, which is a sans-serif font IMO not suited for print; its advantage would be that it provides a unitary look for all CJK languages, less good looking, but more legible * the Hanazono font, which has impressive support for all the characters in CJK Unicode sets, but was created in a wiki way, so IMO it's not very consistent throughout the whole spectrum, and not as esthetically looking as the others
*** Q5: Should a less good looking, but smaller and more consistent font be used? If yes, which one? ***
The Droid font is actually quite small compared to the others, and on smaller font sizes it is more readable.
I prefer normal fonts, because nowadays we usually use a browser and large display @@..
I would really appreciate some feedback on this topic.
On 11/01/2011 11:07 PM, Yang Li wrote:
? 2011/11/2 10:46, Sergiu Dumitriu ??:
Hey community,
I spent some time trying to make PDF export work for CJK (Chinese, Japanese, Korean) characters, and managed to get it working quite well.
Searching for some good open source fonts, I finally decided on the following:
- CJK Unifonts (Linux re-packaging of the Arphic fonts) - IPAGothic - Baekmuk
The first one comes in two variants, serif (a.k.a. ming or song) and script (regular script, kai), and has good support for Chinese, with good, but not complete, support for Japanese, and no support for Korean. It looks very good in both variants, but we should decide on one of them. I uploaded samples on http://jira.xwiki.org/browse/XWIKI-7106 to see how they would look.
*** Q1: Should Kai or Ming be used as the default export font for Chinese? ***
I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace.
As a Chinese, I strongly recommend *song* , the most poluar font, and we seldom use ming in official documents...
Reading on Wikipedia http://en.wikipedia.org/wiki/Ming_%28typefaces%29 I got the impression that there isn't a clear distinction between Ming and Song, and some refer to the same thing with both terms. Looking at the list of CJK fonts http://en.wikipedia.org/wiki/List_of_CJK_fonts none of the fonts that have Song in their name are under an open source friendly license, so they can't be redistributed. Please take a look at the sample PDF and see if it is acceptably similar to Song: http://jira.xwiki.org/secure/attachment/23886/ming-over-freefont.pdf
The second font, IPAGothic, is centered on Japanese, so it has good support for Japanese, some support for Chinese, and no support for Korean. It is a sans-serif variant.
The third font, Baekmuk, brings support for Korean (laking from the other two fonts), along with little support for some Chinese and Japanese characters. This one comes in more variants, but only two are complete enough to be considered, Batang as the serif equivalent, and Gulim as the sans-serif equivalent.
*** Q2: Should Batang or Gulim be used for Korean? ***
My opinion is that the serif variant looks better on print, although less readable. Still, I've seen Gulim much more often used in practice. I attached two samples for this as well to the Jira issue.
*** Q3: Should the current FreeSerif font be used for non-CJK characters, or the font face defined in the font specific to each language? ***
While I prefer FreeSerif for all English text, I've seen in practice that the preferred solution is to use a bulkier font for numbers and latin characters. FreeSerif is good.
OK, noted.
*** Q4: Does italics/oblique make sense for CJK characters? ***
The concept of Italics is defined only for latin-like characters, and no font provides support for italics CJK. Still, Firefox does render slanted characters for CJK text inside <em>. FOP, the rendering engine used for generating PDFs, does not have support for automatically slanting fonts that don't provide an italics variant, and will insist on choosing a font that comes in an italics variant. So, this means that by default any text that is emphasized in the wiki will not be displayed in the PDF correctly (they would appear as # characters). There is a simple solution, and that is to alter the font file so that is says that both the regular and italic version of the font are in the file. Another option is to actually provide an oblique version of the font, which FontForge seems to be able to do quickly and with good results. Still, this will double the size of the fonts, so I'd rather not provide italic fonts if they don't actually make much sense for native CJK users.
In fact, Chinese people use bold font to emphasize (hei), not italics, and we seldom use italics.
OK, so this means that italics doesn't make sense, which is good. The bad news is that FOP doesn't support making characters bold when there's no predefined font, either, but it won't fall back to a font that does provide bold. This means that bold text will appear the same way as regular CJK. I tried to generate a bold font from FontForge, but it fails with an error message: "some fragments did not join". So, our hope is that FOP will implement this feature soon.
Some other fonts that I looked at were: * the Droid font used in Android devices, which is a sans-serif font IMO not suited for print; its advantage would be that it provides a unitary look for all CJK languages, less good looking, but more legible * the Hanazono font, which has impressive support for all the characters in CJK Unicode sets, but was created in a wiki way, so IMO it's not very consistent throughout the whole spectrum, and not as esthetically looking as the others
*** Q5: Should a less good looking, but smaller and more consistent font be used? If yes, which one? ***
The Droid font is actually quite small compared to the others, and on smaller font sizes it is more readable.
I prefer normal fonts, because nowadays we usually use a browser and large display @@..
I would really appreciate some feedback on this topic.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
? 2011/11/2 12:00, Sergiu Dumitriu ??:
*** Q1: Should Kai or Ming be used as the default export font for Chinese? ***
I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace.
As a Chinese, I strongly recommend *song* , the most poluar font, and we seldom use ming in official documents...
Reading on Wikipedia I got the impression that there isn't a clear distinction between Ming and Song, and some refer to the same thing with both terms. Looking at the list of CJK fonts http://en.wikipedia.org/wiki/List_of_CJK_fonts none of the fonts that have Song in their name are under an open source friendly license, so they can't be redistributed. Please take a look at the sample PDF and see if it is acceptably similar to Song: http://jira.xwiki.org/secure/attachment/23886/ming-over-freefont.pdf According to the wikipedia http://en.wikipedia.org/wiki/Ming_%28typefaces%29
The names Song (or Sung) and Ming correspond to the Song Dynasty <http://en.wikipedia.org/wiki/Song_Dynasty> when a distinctive printed style of regular script <http://en.wikipedia.org/wiki/Regular_script> was developed, and the Ming Dynasty <http://en.wikipedia.org/wiki/Ming_Dynasty> during which that style developed into the Ming typeface style.^[1] <http://en.wikipedia.org/wiki/Ming_%28typefaces%29#cite_note-kinkido-0> In Mainland China, the most common name is Song (the Mainland Chinese standardized Ming typeface in Microsoft Windows <http://en.wikipedia.org/wiki/Microsoft_Windows> being named SimSun). In Hong Kong <http://en.wikipedia.org/wiki/Hong_Kong>, Taiwan <http://en.wikipedia.org/wiki/Taiwan>, Japan <http://en.wikipedia.org/wiki/Japan> and Korea <http://en.wikipedia.org/wiki/Korea>, Ming is prevalent. In Hong Kong and Taiwan, "Song typeface" (??) has been used but "Ming typeface" (??) has increased currency since the advent of desktop publishing <http://en.wikipedia.org/wiki/Desktop_publishing>. Some type foundries <http://en.wikipedia.org/wiki/Type_foundry>^[2] <http://en.wikipedia.org/wiki/Ming_%28typefaces%29#cite_note-1> use "Song" to refer to this style of typeface that follows a standard such as the Standard Form of National Characters <http://en.wikipedia.org/wiki/Standard_Form_of_National_Characters>, and "Ming" to refer to typefaces that resemble forms found in the Kangxi dictionary <http://en.wikipedia.org/wiki/Kangxi_dictionary>. ------------------------------------------------------------------------ Ming and Song (or Sung) is different indeed, and Song is popular in Mainland China while Ming is popular in HK, TW, or JP and so on. They are similar, however, Song has more sharp angles or corners than Ming, while Ming has smooth ones, illustrated in the following two pictures(Ming and Song): Actually, there seems to be both Ming and Song available according to http://en.wikipedia.org/wiki/Arphic_Public_License#Arphic_Public_License But I cannot find where to download the fonts...
? 2011/11/2 12:00, Sergiu Dumitriu ??:
*** Q1: Should Kai or Ming be used as the default export font for Chinese? ***
I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace.
As a Chinese, I strongly recommend *song* , the most poluar font, and we seldom use ming in official documents...
Reading on Wikipedia http://en.wikipedia.org/wiki/Ming_%28typefaces%29 I got the impression that there isn't a clear distinction between Ming and Song, and some refer to the same thing with both terms. Looking at the list of CJK fonts http://en.wikipedia.org/wiki/List_of_CJK_fonts none of the fonts that have Song in their name are under an open source friendly license, so they can't be redistributed. Please take a look at the sample PDF and see if it is acceptably similar to Song: http://jira.xwiki.org/secure/attachment/23886/ming-over-freefont.pdf Anyway, similar and acceptable :)
On 11/02/2011 01:45 AM, Yang Li wrote:
? 2011/11/2 12:00, Sergiu Dumitriu ??:
*** Q1: Should Kai or Ming be used as the default export font for Chinese? ***
I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace.
As a Chinese, I strongly recommend *song* , the most poluar font, and we seldom use ming in official documents...
Reading on Wikipedia I got the impression that there isn't a clear distinction between Ming and Song, and some refer to the same thing with both terms. Looking at the list of CJK fonts http://en.wikipedia.org/wiki/List_of_CJK_fonts none of the fonts that have Song in their name are under an open source friendly license, so they can't be redistributed. Please take a look at the sample PDF and see if it is acceptably similar to Song: http://jira.xwiki.org/secure/attachment/23886/ming-over-freefont.pdf According to the wikipedia http://en.wikipedia.org/wiki/Ming_%28typefaces%29
The names Song (or Sung) and Ming correspond to the Song Dynasty <http://en.wikipedia.org/wiki/Song_Dynasty> when a distinctive printed style of regular script <http://en.wikipedia.org/wiki/Regular_script> was developed, and the Ming Dynasty <http://en.wikipedia.org/wiki/Ming_Dynasty> during which that style developed into the Ming typeface style.^[1] <http://en.wikipedia.org/wiki/Ming_%28typefaces%29#cite_note-kinkido-0> In Mainland China, the most common name is Song (the Mainland Chinese standardized Ming typeface in Microsoft Windows <http://en.wikipedia.org/wiki/Microsoft_Windows> being named SimSun). In Hong Kong <http://en.wikipedia.org/wiki/Hong_Kong>, Taiwan <http://en.wikipedia.org/wiki/Taiwan>, Japan <http://en.wikipedia.org/wiki/Japan> and Korea <http://en.wikipedia.org/wiki/Korea>, Ming is prevalent. In Hong Kong and Taiwan, "Song typeface" (??) has been used but "Ming typeface" (??) has increased currency since the advent of desktop publishing <http://en.wikipedia.org/wiki/Desktop_publishing>. Some type foundries <http://en.wikipedia.org/wiki/Type_foundry>^[2] <http://en.wikipedia.org/wiki/Ming_%28typefaces%29#cite_note-1> use "Song" to refer to this style of typeface that follows a standard such as the Standard Form of National Characters <http://en.wikipedia.org/wiki/Standard_Form_of_National_Characters>, and "Ming" to refer to typefaces that resemble forms found in the Kangxi dictionary <http://en.wikipedia.org/wiki/Kangxi_dictionary>. ------------------------------------------------------------------------ Ming and Song (or Sung) is different indeed, and Song is popular in Mainland China while Ming is popular in HK, TW, or JP and so on. They are similar, however, Song has more sharp angles or corners than Ming, while Ming has smooth ones, illustrated in the following two pictures(Ming and Song):
Actually, there seems to be both Ming and Song available according to http://en.wikipedia.org/wiki/Arphic_Public_License#Arphic_Public_License But I cannot find where to download the fonts...
Yeah, tell me about it, in the end I used the ones repackaged in CJKUnifonts, which only provide UKai and UMing. After searching some more I found their Song variant, but it's older and less complete than the other two. Anyway, thanks a lot for the feedback, you've been of great help. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sorry but I can't really vote on this (not enough knowledge). If the vote is about including chinese/japanese/korean fonts by default (and their are under a compatible open source license) then +1 from me. As for the details I trust you and our chinese/japanese/korean community to choose the best solution. Thanks -Vincent On Nov 2, 2011, at 3:46 AM, Sergiu Dumitriu wrote:
Hey community,
I spent some time trying to make PDF export work for CJK (Chinese, Japanese, Korean) characters, and managed to get it working quite well.
Searching for some good open source fonts, I finally decided on the following:
- CJK Unifonts (Linux re-packaging of the Arphic fonts) - IPAGothic - Baekmuk
The first one comes in two variants, serif (a.k.a. ming or song) and script (regular script, kai), and has good support for Chinese, with good, but not complete, support for Japanese, and no support for Korean. It looks very good in both variants, but we should decide on one of them. I uploaded samples on http://jira.xwiki.org/browse/XWIKI-7106 to see how they would look.
*** Q1: Should Kai or Ming be used as the default export font for Chinese? ***
I'm far from being an expert here, but my opinion is that the Kai variant, with it's handwritten look, is better suited for printed material. Still, PDFs are also used on screen, be that a large computer monitor or a handheld device, and on screen the legibility of the Ming variant is better. One option that I like is to use Kai for normal text and Ming for tt/code elements, as a kind of monospace.
The second font, IPAGothic, is centered on Japanese, so it has good support for Japanese, some support for Chinese, and no support for Korean. It is a sans-serif variant.
The third font, Baekmuk, brings support for Korean (laking from the other two fonts), along with little support for some Chinese and Japanese characters. This one comes in more variants, but only two are complete enough to be considered, Batang as the serif equivalent, and Gulim as the sans-serif equivalent.
*** Q2: Should Batang or Gulim be used for Korean? ***
My opinion is that the serif variant looks better on print, although less readable. Still, I've seen Gulim much more often used in practice. I attached two samples for this as well to the Jira issue.
*** Q3: Should the current FreeSerif font be used for non-CJK characters, or the font face defined in the font specific to each language? ***
While I prefer FreeSerif for all English text, I've seen in practice that the preferred solution is to use a bulkier font for numbers and latin characters.
*** Q4: Does italics/oblique make sense for CJK characters? ***
The concept of Italics is defined only for latin-like characters, and no font provides support for italics CJK. Still, Firefox does render slanted characters for CJK text inside <em>. FOP, the rendering engine used for generating PDFs, does not have support for automatically slanting fonts that don't provide an italics variant, and will insist on choosing a font that comes in an italics variant. So, this means that by default any text that is emphasized in the wiki will not be displayed in the PDF correctly (they would appear as # characters). There is a simple solution, and that is to alter the font file so that is says that both the regular and italic version of the font are in the file. Another option is to actually provide an oblique version of the font, which FontForge seems to be able to do quickly and with good results. Still, this will double the size of the fonts, so I'd rather not provide italic fonts if they don't actually make much sense for native CJK users.
Some other fonts that I looked at were: * the Droid font used in Android devices, which is a sans-serif font IMO not suited for print; its advantage would be that it provides a unitary look for all CJK languages, less good looking, but more legible * the Hanazono font, which has impressive support for all the characters in CJK Unicode sets, but was created in a wiki way, so IMO it's not very consistent throughout the whole spectrum, and not as esthetically looking as the others
*** Q5: Should a less good looking, but smaller and more consistent font be used? If yes, which one? ***
The Droid font is actually quite small compared to the others, and on smaller font sizes it is more readable.
I would really appreciate some feedback on this topic. -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (4)
-
Sergiu Dumitriu -
Vincent Massol -
yang Li -
Yang Li