On Fri, May 13, 2005 at 11:44:59AM +0900, [EMAIL PROTECTED] wrote:
> Hi
>
> On Thu, 12 May 2005 23:44:11 +0800
> Chia I Wu <[EMAIL PROTECTED]> wrote:
> >As fontconfig and xft already have the code to "embolden" and rely on
> >FT_GlyphSlot_Embolden to do the real job, I think FT_GlyphSlot_Embolden
> >should be made standard API. This is an important feature for Chinese
> >(maybe also Japanese and Korean) users, as most Chinese fonts don't have
> >a real bold style.
> >
> >What do you think?
>
> I'm unfamiliar with this API and never checked the bolden result in
> detail, could you show some demo program?
I've made a quick hack to ftview.c for demo. See applied patch.
>
> As you pointed out, most CJK font family does not provide "bold" style.
> I think "weight" (XXX-Light, XXX-Medium, XXX-Heavy etc) - may take
> similar role of it in the typographical viewpoint. But, most personal
> computers are shipped with only 1 or 2 fonts for each CJK scripts,
> and synthesized "bold" is often used in documents generated by PC.
The only commercial fonts I own are Dynaware's. They have severial
weights for each family, named by XXX-W3, XXX-W4, XXX-W5, etc. But no
application take advantage of that to get better quality.
Also, the size of a Chinese font is very large, ranaging from 5MB to
25MB (the 25MB one includes glyphs of both traditional and simplicial
Chinese). I personally prefer synthesized bold than having all those
weights installed.
>
> Considering there is such root of embolding request, I wonder whether
> FT_GlyphSlot_Embolden() API is already enough for the purpose. It does
> not receive much parameters to control embolding (am I misunderstanding?).
> I'm afraid several control parameters are requested in future, for example:
>
> * strength to embolding
I think this is important.
> * switch to enable/disable changing glyph metrics in embolding
> * switch to enable/disable embolding of bitmap font
I think glyph metrics should be changed automagically. Bitmap glyph
should be emboldened automatically too. As we are synthesizing, you know
you can't expect a high-quality result, thus it makes no difference
which format the glyph is in.
> * choosing embolding algorithm
>
BTW, I have done some experiment to embolden a bitmap glyph, by printing
the same glyph severial times (depending on strength), with starting
point shift to the right by 1 pixel each time. The result is ok.
> How do you think of?
>
> Regards,
> mpsuzuki
Index: src/ftview.c
===================================================================
RCS file: /cvsroot/freetype/ft2demos/src/ftview.c,v
retrieving revision 1.58
diff -u -r1.58 ftview.c
--- src/ftview.c 4 Mar 2005 05:58:35 -0000 1.58
+++ src/ftview.c 13 May 2005 06:06:25 -0000
@@ -131,20 +131,23 @@
gindex = get_glyph_index( gindex );
#endif
error = FT_Load_Glyph( size->face, i, FT_LOAD_NO_BITMAP );
- if ( !error && slot->format == FT_GLYPH_FORMAT_OUTLINE )
+ if ( !error )
{
FT_Glyph glyphb;
+ FT_GlyphSlot_Embolden( slot);
error = FT_Get_Glyph( slot, &glyphp );
if ( error )
goto Next;
+ /*
error = FT_Glyph_Stroke( &glyphp, stroker, 1 );
if ( error )
{
FT_Done_Glyph( glyphp );
goto Next;
}
+ */
error = glyph_to_bitmap( glyphp, &bit3, &left, &top,
&x_advance, &y_advance, (FT_Pointer*)&glyphb
);
@@ -654,7 +657,8 @@
break;
case grKEY( ' ' ):
- render_mode = ( render_mode + 1 ) % 4;
+ //render_mode = ( render_mode + 1 ) % 4;
+ render_mode = (render_mode == 0) ? 2 : 0;
switch ( render_mode )
{
case 0:
@@ -664,9 +668,8 @@
new_header = (char*)"rendering test text string";
break;
case 2:
- new_header = (char*)"rendering stroked text";
+ new_header = (char*)"rendering emboldened text";
break;
-
default:
new_header = (char*)"rendering glyph waterfall";
}
_______________________________________________
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel