fonts for gfxmenu, help needed
hi list
My friend brought me attention to this thread, and I am very glad to see a better CJK support is now on the agenda of grub. As a Chinese font developer, I am willing to help, share information or build fonts for this specific need.
I wasn't really following how fonts were used in grub, and still had the (wrong) impression that only 256 glyphs are allowed for each file. After opening the overlay_2009-07-19 tarball, I saw large files such as unifont are included, so, I guess now grub is able to handle the full unicode (or BMP) fonts including CJK ones, is this correct? do they have to be bitmaps?
If the answers to my above questions are "yes", then I think you may consider a customized version of "WenQuanYi Bitmap Song" [1], which is a multi-strike bitmap font containing >27000 Chinese Han glyphs at 9pt,10pt,10.5pt,11pt and 12pt sizes. The Latin part of this font are not "monospaced", but we can either merge it with other mono Latin fonts (GPL compatible), or use fallback to get around it.
I saw you already have the later version of GNU Unifont installed, if that's the case, then you can skip the 12pt of WenQuanYi Bitmap Song, because most of the CJK glyphs in Unifont 5.1 were ported from WQY's bitmap font last year by Paul Hardy [2].
About format, I don't know if you can use ttf file, or SFNT ttf file (with only embedded bitmaps). WQY Bitmap Song has an SFNT TTF version [3]. It appears that freetype2 works fine with it, but fontconfig has difficulties. Using SFNT TTF, the uncompressed font size is about 3M (with 9,10,11,12pt),which is fairly lightweight.
If grub happens to be able to process vector ttf fonts, I would recommend DroidSansFallback [4] or the derived WenQuanYi Micro Hei [5]. They both covers a huge span of languages, and the second one have a lot more CJK glyphs and both proportional and monospaced species.
Please let me know if you have any further comments,
Qianqian
[1] http://wenq.org/enindex.cgi?BitmapSong_en
[2] http://unifoundry.com/unifont.html
[3] http://sourceforge.net/projects/wqy/files/wqy-bitmapfont-pkgsrc/0.8.1/
[4] http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=data/fonts;hb=HEAD
[5] http://wenq.org/enindex.cgi?MicroHei%28en%29
*From*: Michal Suchanek
*Subject*: Re: fonts for gfxmenu, help needed
*Date*: Wed, 25 Nov 2009 17:04:59 +0100
------------------------------------------------------------------------
2009/11/25 feng shu <address@hidden>:
Quoted 12 lines
/ 2009/11/25 Vladimir 'Ï-coder/phcoder' Serbinenko <address@hidden>:/ /> Michal Suchanek wrote:/
/>>/
/>> Also if worse comes to worst Indic, Arabic or Hebrew can be feasibly/ />> written in Latin, Chinese cannot./
/>>/
/> pinyin. I know it's disagreable to read for native speakers, but it's/ /> similar for Arabic.// show grub menu with pinyin? Âit is very very stupid./
I guess most people in Europe simply don't understand that pinyin is unreadable.
Fortunately, displaying Chinese characters should be well within the capabilities of current gfxterm although the font is likely poor quality.
Any testers who can tell the difference between commonly used Chinese fonts and GNU Unifont are welcome.
Thanks
Michal
Am Mittwoch, den 25.11.2009, 23:38 -0500 schrieb Qianqian Fang:
Quoted 8 lines
hi list
My friend brought me attention to this thread, and I am very glad to see a better CJK support is now on the agenda of grub. As a Chinese font developer, I am willing to help, share information or build fonts for this specific need.
Quoted 7 lines
I wasn't really following how fonts were used in grub, and still had the (wrong) impression that only 256 glyphs are allowed for each file. After opening the overlay_2009-07-19 tarball, I saw large files such as unifont are included, so, I guess now grub is able to handle the full unicode (or BMP) fonts including CJK ones, is this correct? do they have to be bitmaps?
Even with the old .pff font format the whole unicode was possible but it was just slow IIRC.
At least it was slow with first version of .pf2 or grub-mkfont. The .pf2 format itself is bitmap but see below. As input for grub-mkfont they can be TTF.
Quoted 9 lines
If the answers to my above questions are "yes", then I think you may consider a customized version of "WenQuanYi Bitmap Song" [1], which is a multi-strike bitmap font containing >27000 Chinese Han glyphs at 9pt,10pt,10.5pt,11pt and 12pt sizes. The Latin part of this font are not "monospaced", but we can either merge it with other mono Latin fonts (GPL compatible), or use fallback to get around it.
Quoted 6 lines
I saw you already have the later version of GNU Unifont installed, if that's the case, then you can skip the 12pt of WenQuanYi Bitmap Song, because most of the CJK glyphs in Unifont 5.1 were ported from WQY's bitmap font last year by Paul Hardy [2].
Yes in the Debian/Ubuntu packages we use Paul Hardy's version.
Quoted 8 lines
About format, I don't know if you can use ttf file, or SFNT ttf file (with only embedded bitmaps). WQY Bitmap Song has an SFNT TTF version [3]. It appears that freetype2 works fine with it, but fontconfig has difficulties. Using SFNT TTF, the uncompressed font size is about 3M (with 9,10,11,12pt),which is fairly lightweight.
Quoted 6 lines
If grub happens to be able to process vector ttf fonts, I would recommend DroidSansFallback [4] or the derived WenQuanYi Micro Hei [5]. They both covers a huge span of languages, and the second one have a lot more CJK glyphs and both proportional and monospaced species.
As input format for grub-mkconf we support everything libfreetype supports, so TTF too.
Quoted 3 lines
Please let me know if you have any further comments,
Qianqian
Signature · 2 lines
Felix Zielcke Proud Debian Maintainer and GNU GRUB developer
Quoted 6 lines · Felix Zielcke
Even with the old .pff font format the whole unicode was possible but it was just slow IIRC.
At least it was slow with first version of .pf2 or grub-mkfont. The .pf2 format itself is bitmap but see below. As input for grub-mkfont they can be TTF.
that's great, does the font have to be monospaced (or dual-width for CJK)? what code point range you want this CJK font file to provide? CJK glyphs only?
Quoted 3 lines
As input format for grub-mkconf we support everything libfreetype supports, so TTF too.
I guess you meant grub-mkfont. If that's the case, i.e. grub can handle gray-scale bitmaps, then, use grub-mkconf to convert WenQuanYi Micro Hei (Mono) will be my second recommendation next to the wqy bitmap song solution.
If grub happens to use fontconfig to handle fallback relationship, you do need to be aware about this bug, as fontconfig does not have everything to handle sfnt ttf format:
https://bugs.freedesktop.org/show_bug.cgi?id=23336
2009/11/26 Qianqian Fang <[email protected]>:
Quoted 10 lines
Quoted 7 lines · Felix Zielcke
Even with the old .pff font format the whole unicode was possible but it was just slow IIRC.
At least it was slow with first version of .pf2 or grub-mkfont. The .pf2 format itself is bitmap but see below. As input for grub-mkfont they can be TTF.that's great, does the font have to be monospaced (or
Grub is capable of displaying variable width fonts but monospace fonts may be preferred for some uses.
Quoted 2 lines
dual-width for CJK)? what code point range you want this CJK font file to provide? CJK glyphs only?
Ideally grub should use as few fonts as possible so a font with both CJK glyphs and Latin glyphs is preferable.
As you pointed out the glyphs in Unifont are mostly ported from wqy fonts so unifont would be one such font.
We may need a special font for Japanese and a method to load different primary font when displaying the grub menu in Japanese is desired or extend grub to support combining variant marks.
Unfortunately, unifont is only provided in single variant and size which is most troublesome in my view.
I expect that theme authors would want at least two font variants (Song, Hei) and some larger font sizes for captions or displaying simple few line menu on high resolution screens.
Quoted 7 lines
Quoted 4 lines
As input format for grub-mkconf we support everything libfreetype supports, so TTF too.
I guess you meant grub-mkfont. If that's the case, i.e. grub can handle gray-scale bitmaps, then, use grub-mkconf to convert
Grub does not support grayscale in its font format. The pf2 files are a collection of 1bit deep transparency masks.
Quoted 7 lines
WenQuanYi Micro Hei (Mono) will be my second recommendation next to the wqy bitmap song solution.
If grub happens to use fontconfig to handle fallback relationship, you do need to be aware about this bug, as fontconfig does not have everything to handle sfnt ttf format:
https://bugs.freedesktop.org/show_bug.cgi?id=23336
Grub does not use fontconfig.
Thanks
Michal
Quoted 10 lines · Michal Suchanek
Grub is capable of displaying variable width fonts but monospace fonts may be preferred for some uses.
Ideally grub should use as few fonts as possible so a font with both CJK glyphs and Latin glyphs is preferable.
As you pointed out the glyphs in Unifont are mostly ported from wqy fonts so unifont would be one such font.
We may need a special font for Japanese and a method to load different primary font when displaying the grub menu in Japanese is desired or extend grub to support combining variant marks.
Quoted 6 lines
Unfortunately, unifont is only provided in single variant and size which is most troublesome in my view.
I expect that theme authors would want at least two font variants (Song, Hei) and some larger font sizes for captions or displaying simple few line menu on high resolution screens.
ok, I think I am getting clear now. Grub can load pan-unicode (1-bit) bitmap fonts of various sizes. Grub needs 1) good bitmap fonts with CJK coverage (and possibility Latin) at multiple point sizes, 2) preferably with Song and Hei styles as well as
3) Han glyph CJK variant support.
Personally, I would rank the likelihood of the above goals in 1>3>2. Basically, for #1, WQY Bitmap Song (xfonts-wqy in Debian/Ubuntu) is what you are looking for (together with GNU unifont).
For #2, it depends on how grub handles language and fallback and does need a lot of cautions, otherwise, it can be a pain. AFAIK, there are not many good free Japanese bitmap fonts covers the 9~12pt ranges. Mplus [1] bitmaps have OK quality, but only have 8pt and 9pt (8pt is not a readable size); then efonts [2], xfonts-intl-japanese, GNU intlfonts [3] and HabianCJK [4] contain pretty much the same set of low-quality Kanji bitmaps at 9pt, 10.5pt, 18pt and 24px, where IMHO, the 9pt and 10.5pt are rather not readable; 18pt is sort of ok, but wider than GNU unifont by 1px.
If you really want to include Japanese bitmaps, you may also try to convert DroidSansJapanese [5]. But I think it needs a lot of fine tuning in order to get the rasterized glyphs readable.
For #3, it is difficult, and probably not necessary. The differences between Song/Mincho and Hei/Gothic is rather not distinguishable in screen sizes. You have to get above 20pt to see differences (which is largely weight different). We call WQY bitmap song, but truly, it is not really the Song style, because we eliminated all the serif due to small space.
If what you meant is to have "another style" in addition to what we have in GNU unifont, then, you may rasterize WQY Micro Hei [6] or WQY Zen Hei [7] to bitmaps, but again, I don't have faith on the readability of the outcome unless someone spend years to manually fine tune.
In summary, I think goal #1 is ready to go, #2 needs more input from Japanese users, and some additional work; #3 needs a lot of work, and perhaps not really that important.
Also, I want to add that Japanese people CAN read simplified-Chinese styled Kanji. It's not pleasant, but not unrecognizable (it's like simplified Chinese users can understand traditional Chinese, but they don't use it).
Qianqian
[1] http://mplus-fonts.sourceforge.jp/mplus-bitmap-fonts/index.html
[2] http://openlab.ring.gr.jp/efont/unicode/
[3] http://ftp.gnu.org/gnu/intlfonts/
[4] http://wakaba-web.hp.infoseek.co.jp/hcjk/
[5] http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=data/fonts;hb=HEAD
[6] http://packages.debian.org/search?keywords=ttf-wqy-microhei
[7] http://packages.debian.org/search?keywords=ttf-wqy-zenhei
Quoted 6 lines · Qianqian Fang
ok, I think I am getting clear now. Grub can load pan-unicode (1-bit) bitmap fonts of various sizes. Grub needs 1) good bitmap fonts with CJK coverage (and possibility Latin) at multiple point sizes, 2) preferably with Song and Hei styles as well as
3) Han glyph CJK variant support.
Quoted 8 lines
Personally, I would rank the likelihood of the above goals in 1>3>2. Basically, for #1, WQY Bitmap Song (xfonts-wqy in Debian/Ubuntu) is what you are looking for (together with GNU unifont).
For #2,...
For #3,...
sorry for the confusion on the numbering, when I say #2 or #3, it refers to the likelihood sequence, i.e. #2 means goal 3). and #3 means goal 2).
2009/11/27 Qianqian Fang <[email protected]>:
Quoted 19 lines
Quoted 11 lines · Michal Suchanek
Grub is capable of displaying variable width fonts but monospace fonts may be preferred for some uses.
Ideally grub should use as few fonts as possible so a font with both CJK glyphs and Latin glyphs is preferable.
As you pointed out the glyphs in Unifont are mostly ported from wqy fonts so unifont would be one such font.
We may need a special font for Japanese and a method to load different primary font when displaying the grub menu in Japanese is desired or extend grub to support combining variant marks.Quoted 6 lines
Unfortunately, unifont is only provided in single variant and size which is most troublesome in my view.
I expect that theme authors would want at least two font variants (Song, Hei) and some larger font sizes for captions or displaying simple few line menu on high resolution screens.
Quoted 5 lines
ok, I think I am getting clear now. Grub can load pan-unicode (1-bit) bitmap fonts of various sizes. Grub needs 1) good bitmap fonts with CJK coverage (and possibility Latin) at multiple point sizes, 2) preferably with Song and Hei styles as well as
3) Han glyph CJK variant support.
Grub currently does not support glyph variants. The best we can do to render Japanese properly without much additional works is to load a different font when the menu is supposed to be in Japanese.
Quoted 6 lines
Personally, I would rank the likelihood of the above goals in 1>3>2. Basically, for #1, WQY Bitmap Song (xfonts-wqy in Debian/Ubuntu) is what you are looking for (together with GNU unifont).
Quoted 10 lines
For #2, it depends on how grub handles language and fallback and does need a lot of cautions, otherwise, it can be a pain. AFAIK, there are not many good free Japanese bitmap fonts covers the 9~12pt ranges. Mplus [1] bitmaps have OK quality, but only have 8pt and 9pt (8pt is not a readable size); then efonts [2], xfonts-intl-japanese, GNU intlfonts [3] and HabianCJK [4] contain pretty much the same set of low-quality Kanji bitmaps at 9pt, 10.5pt, 18pt and 24px, where IMHO, the 9pt and 10.5pt are rather not readable; 18pt is sort of ok, but wider than GNU unifont by 1px.
Thanks for these tips. I guess wider by one px is acceptable for an alternate font, the fonts need not be displayed both at the same time. I am not sure if lower quality glyphs of correct shape are preferred over higher quality Chinese glyphs, though. I guess it would also depend on reader preference but it would be nice to hear the opinion of somebody familiar with Japanese.
Quoted 6 lines
If you really want to include Japanese bitmaps, you may also try to convert DroidSansJapanese [5]. But I think it needs a lot of fine tuning in order to get the rasterized glyphs readable.
Quoted 6 lines
For #3, it is difficult, and probably not necessary. The differences between Song/Mincho and Hei/Gothic is rather not distinguishable in screen sizes. You have to get above 20pt to see differences (which is largely weight different). We call WQY bitmap song, but truly, it is not really the Song style, because we eliminated all the serif due to small space.
For me the Song/Mincho variant fonts seem more readable at small sizes. Although the serifs aren't clearly visible they often add weight to the stroke ends and make them easier to recognize. However, this may be matter of preference/reader familiarity with the language/overall font quality/...
I think that there is not much need for smaller fonts than the default 16px/12pt Unifont. It would be nice addition to have a font for fine-print but I am personally more interested in larger font sizes for captions or simple menus on high resolution screens.
In the larger sizes the difference between different font styles is more visible.
Quoted 6 lines
If what you meant is to have "another style" in addition to what we have in GNU unifont, then, you may rasterize WQY Micro Hei [6] or WQY Zen Hei [7] to bitmaps, but again, I don't have faith on the readability of the outcome unless someone spend years to manually fine tune.
I guess it's OK to have only one font face in small size if there aren't any good alternatives.
I would prefer readability over customization in this case. For Latin multiple usable font styles exist at this size but that's because the glyphs are much simpler and fewer so it's easier to draw them in such constrained space.
Quoted 10 lines
In summary, I think goal #1 is ready to go, #2 needs more input from Japanese users, and some additional work; #3 needs a lot of work, and perhaps not really that important.
Also, I want to add that Japanese people CAN read simplified-Chinese styled Kanji. It's not pleasant, but not unrecognizable (it's like simplified Chinese users can understand traditional Chinese, but they don't use it).
I would prefer for grub to offer the option to render each language correctly as long as it is reasonably possible with current grub features and available fonts.
All the additional fonts need not ship with grub. It may suffice to document which fonts look good in grub so that distribution packagers can use grub-mkfont to convert them on the user's machine if the fonts are installed.
Thanks
Michal
Quoted 7 lines · Michal Suchanek
Thanks for these tips. I guess wider by one px is acceptable for an alternate font, the fonts need not be displayed both at the same time. I am not sure if lower quality glyphs of correct shape are preferred over higher quality Chinese glyphs, though. I guess it would also depend on reader preference but it would be nice to hear the opinion of somebody familiar with Japanese.
Using different fonts for different language makes life easier.
Quoted 6 lines
For me the Song/Mincho variant fonts seem more readable at small sizes. Although the serifs aren't clearly visible they often add weight to the stroke ends and make them easier to recognize. However, this may be matter of preference/reader familiarity with the language/overall font quality/...
Quoted 8 lines
I think that there is not much need for smaller fonts than the default 16px/12pt Unifont. It would be nice addition to have a font for fine-print but I am personally more interested in larger font sizes for captions or simple menus on high resolution screens.
In the larger sizes the difference between different font styles is more visible.
I misunderstood the call. You want to have fonts larger than 12pt, not smaller, as we usually concern. That's fine, actually that is a lot easier to handle.
I don't know what sizes you prefer, you can find bitmap resources at typical sizes at 24px/32px/48px. Indeed, using freetype/autohint, the rasterization of the popular CJK fonts may entirely usable at these sizes.
In the following links, I experimented to hint/instruct/rasterize the common CJK fonts, and I think the results are quite usable:
Hei-style:
WQY Micro Hei@24px: http://wenq.org/upload/microhei_24px.png
WQY Micro Hei@32px: http://wenq.org/upload/microhei_32px.png
Song-style:
Japanese Mincho@24px (efont f24):
http://wenq.org/upload/efont_micho_24px.png
Chinese Song@32px (uming): http://wenq.org/upload/uming_32px.png
Except the efont 24px, all screenshots were made by rasterizing vector fonts with freetype2 with autohints. Here are the steps to reproduce:
1. open a TTF/TTC files in fontconfig, navigate to CJK zone (U4E00-U9FCB)
2. select tens to hundreds of glyphs, select menu Hint\Autohint
3. then, goto menu Element\Font Info...\PS Private, hit Add and add multiple PS hints, include StdHW and StdVW, use the guessed values
4. select menu Hint\AutoInstruct
5. select menu Element\Bitmap Strikes Available\, type whatever pixel sizes you want in the 3rd box, check freetype, and click ok
6. now from menu View, select the strike you just generated
As I mentioned earlier, if you want to produce Japanese Hei-style Kanji bitmaps, you can apply the above procedures to DroidSansJapanese. And of course, the bigger the size, the better the results.
Let me know if you need any additional information.
2009/11/28 Qianqian Fang <[email protected]>:
Quoted 11 lines
Quoted 8 lines · Michal Suchanek
Thanks for these tips. I guess wider by one px is acceptable for an alternate font, the fonts need not be displayed both at the same time. I am not sure if lower quality glyphs of correct shape are preferred over higher quality Chinese glyphs, though. I guess it would also depend on reader preference but it would be nice to hear the opinion of somebody familiar with Japanese.
Using different fonts for different language makes life easier.
But slower. In grub loading a font and looking up glyphs in multiple fonts is quite slow, at least in qemu where most people test the feature.
Quoted 37 lines
Quoted 7 lines
For me the Song/Mincho variant fonts seem more readable at small sizes. Although the serifs aren't clearly visible they often add weight to the stroke ends and make them easier to recognize. However, this may be matter of preference/reader familiarity with the language/overall font quality/...
Quoted 8 lines
I think that there is not much need for smaller fonts than the default 16px/12pt Unifont. It would be nice addition to have a font for fine-print but I am personally more interested in larger font sizes for captions or simple menus on high resolution screens.
In the larger sizes the difference between different font styles is more visible.
I misunderstood the call. You want to have fonts larger than 12pt, not smaller, as we usually concern. That's fine, actually that is a lot easier to handle.
I don't know what sizes you prefer, you can find bitmap resources at typical sizes at 24px/32px/48px. Indeed, using freetype/autohint, the rasterization of the popular CJK fonts may entirely usable at these sizes.
In the following links, I experimented to hint/instruct/rasterize the common CJK fonts, and I think the results are quite usable:
Hei-style:
WQY Micro Hei@24px: http://wenq.org/upload/microhei_24px.png
WQY Micro Hei@32px: http://wenq.org/upload/microhei_32px.pngSong-style:
Japanese Mincho@24px (efont f24):
http://wenq.org/upload/efont_micho_24px.png
Chinese Song@32px (uming): http://wenq.org/upload/uming_32px.png
Quoted 5 lines
Except the efont 24px, all screenshots were made by rasterizing vector fonts with freetype2 with autohints. Here are the steps to reproduce:
1. open a TTF/TTC files in fontconfig, navigate to CJK zone (U4E00-U9FCB)
Am I missing something? For me fontconfig was always a commandline tool. I do use some charmap tools but onen of them comes with fontconfig.
Quoted 4 lines
2. select tens to hundreds of glyphs, select menu Hint\Autohint
3. then, goto menu Element\Font Info...\PS Private, hit Add and add multiple PS hints, include StdHW and StdVW, use the guessed values
4. select menu Hint\AutoInstruct
I wonder if this is reproducible with grub-mkfont.
Also is autohinting free enough to be enabled in Debian and other distribution packages? I don't recall the exact details of the patent issues with different font rendering methods.
Quoted 8 lines
5. select menu Element\Bitmap Strikes Available\, type whatever pixel sizes you want in the 3rd box, check freetype, and click ok
6. now from menu View, select the strike you just generatedAs I mentioned earlier, if you want to produce Japanese Hei-style Kanji bitmaps, you can apply the above procedures to DroidSansJapanese. And of course, the bigger the size, the better the results.
I am not sure this is optimal method of rasterizing fonts. Perhaps grub should be improved to handle vector graphics or at least fonts rasterized into greyscale.
The uming_32px contains pretty large and mostly nice glyphs but they are still clearly pixelated, even at this size.
Given the 1-bit bitmap limitation most glyphs look pretty good but the 灱 glyph just above the UmingCN title in the taskbar is particularly ugly. Is this an expected limitation of this rendering method that some glyphs simply turn out ugly or is this a bug in the font?
Thanks
Michal
Quoted 3 lines · Michal Suchanek
Am I missing something? For me fontconfig was always a commandline tool. I do use some charmap tools but onen of them comes with fontconfig.
I am sorry, I meant "fontforge", not fontconfig. Those are the steps to prepare a bitmap font (in bdf format, then you can convert it to pf2)
Quoted 6 lines
I wonder if this is reproducible with grub-mkfont.
Also is autohinting free enough to be enabled in Debian and other distribution packages? I don't recall the exact details of the patent issues with different font rendering methods.
I don't think so, but you can try. A good resterization requires the font itself to contain the so called "hints", either PS hints or TTF hints. But most free CJK vector fonts don't have it build-in. That's why I have the steps to produce those in fontforge.
Autohint is fine, the same for PS hints. It is the truetype hint that has a patent, but I heard it got expired this Oct. I don't know if it has been renewed or not. Ubuntu ships byte-code-enabled freetype. Debian doesn't (at least a few years ago).
Quoted 4 lines
I am not sure this is optimal method of rasterizing fonts. Perhaps grub should be improved to handle vector graphics or at least fonts rasterized into greyscale.
As I said, to produce a good resterization, the font file need to contain hints, but almost all free CJK fonts don't have. I don't think grub can help in this aspect, unless you port the "stem-extraction" code from fontforge, that's a lot of work.
Quoted 8 lines
The
uming_32pxcontains pretty large and mostly nice glyphs but they are still clearly pixelated, even at this size.Given the 1-bit bitmap limitation most glyphs look pretty good but the 灱 glyph just above the UmingCN title in the taskbar is particularly ugly. Is this an expected limitation of this rendering method that some glyphs simply turn out ugly or is this a bug in the font?
I am not sure which glyph you are referring to, but if you are talking about the AA-ed small-sized Han glyphs above each bitmap, it is the direct rendering results from ZenHei by freetype2, without embedded bitmaps and autohint, and yes, they look blurry. In fact, all of the CJK fonts will look blurry at that size. Fortunately, ZenHei has embedded bitmaps.
Quoted 11 lines
Thanks
Michal
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 5 lines · Michal Suchanek
Given the 1-bit bitmap limitation most glyphs look pretty good but the 灱 glyph just above the UmingCN title in the taskbar is particularly ugly. Is this an expected limitation of this rendering method that some glyphs simply turn out ugly or is this a bug in the font?
ok, now I see which glyph you were talking about. No, to me, "灱" is not particularly ugly. It has comparable quality to others. They are definitely sub-optimal compared with the manually hinted bitmaps, but they are usable for this size.
2009/11/28 Qianqian Fang <[email protected]>:
Quoted 8 lines
Quoted 6 lines · Michal Suchanek
Given the 1-bit bitmap limitation most glyphs look pretty good but the 灱 glyph just above the UmingCN title in the taskbar is particularly ugly. Is this an expected limitation of this rendering method that some glyphs simply turn out ugly or is this a bug in the font?
Quoted 4 lines
ok, now I see which glyph you were talking about. No, to me, "灱" is not particularly ugly. It has comparable quality to others. They are definitely sub-optimal compared with the manually hinted bitmaps, but they are usable for this size.
It's good enough to read the character but if I designed a theme with this character in some large caption I would immediately start looking for a font that has a decent glyph for this character. It's far from nice to look at.
Thanks
Michal
Quoted 5 lines · Michal Suchanek
It's good enough to read the character but if I designed a theme with this character in some large caption I would immediately start looking for a font that has a decent glyph for this character. It's far from nice to look at.
I was talking about "rasterization quality", do you mean the aesthetics of the glyph topology/structure?
However, I am pretty sure you don't need to worry about "灱" because it is an extremely rarely used character and was only used in ancient literatures. As a matter of fact, in the over 20,000 Han char. included in the fonts I mentioned, the top 3,000~4,000 covers 99.6% of the use in modern Chinese [1].
[1] http://www.jiyili.net/thread-27521-1-1.html
(based on a national survey in 1980s)
Quoted 11 lines
Thanks
Michal
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 7 lines · Qianqian Fang
Quoted 5 lines · Michal Suchanek
It's good enough to read the character but if I designed a theme with this character in some large caption I would immediately start looking for a font that has a decent glyph for this character. It's far from nice to look at.
Quoted 9 lines
I was talking about "rasterization quality", do you mean the aesthetics of the glyph topology/structure?
However, I am pretty sure you don't need to worry about "灱" because it is an extremely rarely used character and was only used in ancient literatures. As a matter of fact, in the over 20,000 Han char. included in the fonts I mentioned, the top 3,000~4,000 covers 99.6% of the use in modern Chinese [1].
Is it possible to have a font with only these characters plus if necessary some computer-specific characters? I don't expect users to write poems in grub and so such reduced font would be well-suited for applications when size matters (e.g. embedding grub2 into flash rom) Another question: are glyphs imported into unifont from ttf fonts are vector-based?
And also I would like to thank you and Michal that you answered most of the questions I had about Chinese support even without me asking them :)
Quoted 22 lines
[1] http://www.jiyili.net/thread-27521-1-1.html (based on a national
survey in 1980s)Quoted 11 lines
Thanks
Michal
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 5 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Is it possible to have a font with only these characters plus if necessary some computer-specific characters? I don't expect users to write poems in grub and so such reduced font would be well-suited for applications when size matters (e.g. embedding grub2 into flash rom)
certainly we can. However the problem is I don't have char-frequency statistics for Japanese Kanji/Korean Hanja, also even for Chinese, it's from 1980s.
We can try IICore [1], which has about 10,000 char.
[1] http://www.ogcio.gov.hk/ccli/eng/structure/iicorecompare.html
Quoted 3 lines
Another question: are glyphs imported into unifont from ttf fonts are vector-based?
no, they are manually drawn, similar for WenQuanYi's bitmaps. Only that way, you can ensure the clearest look in small glyph sizes (and it took years).
Quoted 8 lines · Qianqian Fang
Quoted 5 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Is it possible to have a font with only these characters plus if necessary some computer-specific characters? I don't expect users to write poems in grub and so such reduced font would be well-suited for applications when size matters (e.g. embedding grub2 into flash rom)
certainly we can. However the problem is I don't have char-frequency statistics for Japanese Kanji/Korean Hanja,
AFAIK Hanja isn't used a lot and in GRUB2 particularly I see only names which could possibly use Hanja. Also quick look into ko.po of glibc doesn't reveal any Hanja (even that I can't read either they have different appearence). But due to nature of Hangul of being basically arranged syllables out of Jamo we need to include whole 111712 precomposed Hangul. And since even important font rendering engines prefered to stay away from Jamo composing except when with historical Jamo I feel like it would be inappropriate to make it in GRUB. As for Kanji we could stick to Jōyō kanji
[http://en.wikipedia.org/wiki/J%C5%8Dy%C5%8D_kanji] (I think we can reasonably suppose that all kanji needed for grub2 are within the school scope)
However I don't pretend to be expert in either Kanji, Hanja, Hangul or Hanzi, so feel free to correct me.
Quoted 2 lines
also even for Chinese,
it's from 1980s.
Are there any reasons to believe more sinograms came into general usage and may be used by grub since then? Will have anyway to have computer-specific glyphs too.
Is the list you provided about Traditional or Simplified Chinese? What about the other variant?
Quoted 2 lines
We can try IICore [1], which has about 10,000 char.
General-usage fonts are good since they are likely to contain all useful (for GRUB) glyphs. It just starts to look that we can't significantly reduce the size of unifont by removing not-so-useful glyphs. 10000 for Simplified Chinese, 10000 for Traditional Chinese and 10000 for Hangul and we already have half of BMP/unifont
Quoted 11 lines
[1] http://www.ogcio.gov.hk/ccli/eng/structure/iicorecompare.html
Quoted 3 lines
Another question: are glyphs imported into unifont from ttf fonts are vector-based?
no, they are manually drawn, similar for WenQuanYi's bitmaps. Only that way, you can ensure the clearest look in small glyph sizes (and it took years).
Wow as a coder I would never have supposed that rasterisation would take so much time and human intervention
Quoted 8 lines
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 6 lines · Vladimir 'φ-coder/phcoder' Serbinenko
AFAIK Hanja isn't used a lot and in GRUB2 particularly I see only names which could possibly use Hanja. Also quick look into ko.po of glibc doesn't reveal any Hanja (even that I can't read either they have different appearence). But due to nature of Hangul of being basically arranged syllables out of Jamo we need to include whole 111712 precomposed Hangul. And since even important font rendering engines
Quoted 9 lines
prefered to stay away from Jamo composing except when with historical Jamo I feel like it would be inappropriate to make it in GRUB. As for Kanji we could stick to Jōyō kanji
[http://en.wikipedia.org/wiki/J%C5%8Dy%C5%8D_kanji] (I think we can reasonably suppose that all kanji needed for grub2 are within the school scope)
However I don't pretend to be expert in either Kanji, Hanja, Hangul or Hanzi, so feel free to correct me.
I am pretty sure there are a lot of options. But at this point, I think I need a clear plan on 1) what pixel sizes, 2) what the number of Hanzi characters and 3) what font styles (song/hei) does grub project need.
In my previous emails, I summarized the resources that
I know of, including
1) free pan-unifont vector fonts that cover most CJK/nonCJK scripts
2) bitmap fonts that have CJK coverage at smaller font sizes
3) a procedure to produce better quality rasterization from vector fonts using fontforge
With these, I think you can pretty much do any combination/slicing you want. I would be glad help to make these bitmap fonts once you decide the specs on the fonts (listed above)
Quoted 4 lines
Are there any reasons to believe more sinograms came into general usage and may be used by grub since then? Will have anyway to have computer-specific glyphs too.
no, I don't think so. Ideographic characters are quite stable now. For general usage, the charset is fixed. What get evolved are their combinations, which we called "words", for example, "电脑","手机". All these characters are ancient, but the combinations represent something new.
Quoted 3 lines
Is the list you provided about Traditional or Simplified Chinese? What about the other variant?
IICore is a combination of simplified/traditional/japanese/korean.
Quoted 6 lines
General-usage fonts are good since they are likely to contain all useful (for GRUB) glyphs. It just starts to look that we can't significantly reduce the size of unifont by removing not-so-useful glyphs. 10000 for Simplified Chinese, 10000 for Traditional Chinese and 10000 for Hangul and we already have half of BMP/unifont
Maybe start with full BMP and see if you have any particular difficulties coming up. Re-slice a BDF file is quite eazy.
2009/11/29 Qianqian Fang <[email protected]>:
Quoted 10 lines
Quoted 6 lines · Michal Suchanek
It's good enough to read the character but if I designed a theme with this character in some large caption I would immediately start looking for a font that has a decent glyph for this character. It's far from nice to look at.
I was talking about "rasterization quality", do you mean the aesthetics of the glyph topology/structure?
Aestetics is relative but uniform stroke width is not.
Quoted 7 lines
However, I am pretty sure you don't need to worry about "灱" because it is an extremely rarely used character and was only used in ancient literatures. As a matter of fact, in the over 20,000 Han char. included in the fonts I mentioned, the top 3,000~4,000 covers 99.6% of the use in modern Chinese [1].
Yes, I suspected it would not be a common character, my character table does not list a meaning for it.
However, similar issue can be seen with the 刀 character in the microhei_24px and microhei_32px rasterization. In fact, the stroke width is almost inverted in these two rasterizations although they are supposedly the same font.
Thanks
Michal
Quoted 10 lines · Michal Suchanek
Aestetics is relative but uniform stroke width is not.
Yes, I suspected it would not be a common character, my character table does not list a meaning for it.
However, similar issue can be seen with the 刀 character in the
microhei_24pxandmicrohei_32pxrasterization. In fact, the stroke width is almost inverted in these two rasterizations although they are supposedly the same font.
I agree with you that the CJK autohinter is far from perfect. It does a much worse job in smaller sizes.
Actually, you can find the unit that does the cjk autohinting, see
http://opensource.apple.com/source/X11proto/X11proto-15.5/freetype/freetype-2.3.9/src/autofit/afcjk.c
(this is a older version though, but just give you an idea)
if anyone want to improve the algorithm in this unit, that will be really useful.
Quoted 11 lines
Thanks
Michal
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
2009/11/30 Qianqian Fang <[email protected]>:
Quoted 7 lines
Quoted 6 lines · Michal Suchanek
Aestetics is relative but uniform stroke width is not.
Yes, I suspected it would not be a common character, my character table does not list a meaning for it.
Quoted 8 lines
Quoted 5 lines
However, similar issue can be seen with the 刀 character in the
microhei_24pxandmicrohei_32pxrasterization. In fact, the stroke width is almost inverted in these two rasterizations although they are supposedly the same font.I agree with you that the CJK autohinter is far from perfect. It does a much worse job in smaller sizes.
If it does decent job on larger font sizes then perhaps we could render a large enough font and rely on bitmap fonts for smaller sizes.
I guess I should also install some more fonts and try to convert them to bitmap in Fontforge.
Quoted 9 lines
Actually, you can find the unit that does the cjk autohinting, see
http://opensource.apple.com/source/X11proto/X11proto-15.5/freetype/freetype-2.3.9/src/autofit/afcjk.c
(this is a older version though, but just give you an idea)if anyone want to improve the algorithm in this unit, that will be really useful.
I can tell a uniform line thickness when I see it but if it was easy to get with the autohinter surely somebody would fix it up.
Thanks
Michal
2009/11/30 Michal Suchanek <[email protected]>:
Quoted 14 lines
2009/11/30 Qianqian Fang <[email protected]>:
Quoted 13 lines
Quoted 11 lines · Michal Suchanek
Aestetics is relative but uniform stroke width is not.
Yes, I suspected it would not be a common character, my character table does not list a meaning for it.
However, similar issue can be seen with the 刀 character in the
microhei_24pxandmicrohei_32pxrasterization. In fact, the stroke width is almost inverted in these two rasterizations although they are supposedly the same font.
Quoted 9 lines
Quoted 2 lines
I agree with you that the CJK autohinter is far from perfect. It does a much worse job in smaller sizes.
If it does decent job on larger font sizes then perhaps we could render a large enough font and rely on bitmap fonts for smaller sizes.
I guess I should also install some more fonts and try to convert them to bitmap in Fontforge.
I tried rasterizing Arphic fonts in Fontforge and I am disappointed.
First, fontforge sucks at this kind of task. There is no reasonable way to select multiple glyphs, save a Unicode range. You can choose them one by one or drag by mouse. The semantic of drag operation is different on selected and non-selected glyphs. Pressing Esc to get out of menu or clicking somewhere deselects the glyphs again with no way of re-selecting the glyphs I was working with. Terrible user interface.
The results of rasterization are also disappointing. The UMingTW font seems somewhat reasonable at 48 and 64 px (but not 52 px so it's probably just a matter of skimming through more glyphs to find some examples of terrible rasterization).
In UKaiTW there is no problem with the 刀 character because its strokes are slanted enough to not get turned into a line with width-stepping but there is a problem with 口 and similar glyphs. The problem are near-vertical or near-horizontal lines that get rasterized quite poorly. Glyphs with multiple vertical or horizontal strokes often get strokes of different widths because some of the strokes get rasterized on the pixel boundary while others do not.
The same issues can be seen in the outline view without antialiasing, and antialiasing greatly improves the glyph shapes, and at least for me it improves readability as well.
So to me rasterizing to bitmaps looks like a dead end. We either need grayscale support or vector support or take only the limited set of fonts which are manually drawn as bitmaps.
Thanks
Michal