[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] 答复: performance on FreeTyp e actions
From: |
David Turner |
Subject: |
Re: [ft-devel] 答复: performance on FreeTyp e actions |
Date: |
Wed, 12 Apr 2006 15:32:38 +0200 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
Hello,
rperez a écrit :
Hi There,
I am trying to use the freetype caching to cache glyphs. It seems that I
managed to do so with one (major) exception - I cant seems to succeed in
advance the pen for each glyph.
I am using the FreeType 2.1.4 and my code goes something like this:
FTC_Image_Cache_Lookup(mFTImageCache, &imageDesc, glyph.id, &glyph.image);
FT_Outline_Get_BBox(&((FT_OutlineGlyph) glyph.image)->outline, &bounds);
FT_Vector_Transform(&glyph.origin,&affine);
FT_Glyph_Transform(glyph.image,&affine,&glyph.origin);
FT_Glyph_To_Bitmap(&glyph.image,ft_render_mode_normal,(FT_Vector *)
NULL,MagickFalse);
bitmap=(FT_BitmapGlyph) glyph.image;
at that point the bitmap->left field should be updated to the right value
but it is always 0.
when I replace
FTC_Image_Cache_Lookup(mFTImageCache, &imageDesc, glyph.id, &glyph.image);
with
FT_Load_Glyph(face,glyph.id,FT_LOAD_NO_BITMAP);
FT_Get_Glyph(face->glyph,&glyph.image);
(not using cache) the bitmap->left field is updated correctly.
any ideas?
First of all, the cache API has changed a bit since 2.1.4, and I advise
you to use the one currently
in CVS (soon to be 2.2) , since it's know officially sanctionned as
"stable". This shouldn't be very
difficult.
Second, the glyph returned by FTC_Image_Cache_Lookup is owned by the
cache sub-system,
and you're not allowed to modify it (e.g. by calling FT_Glyph_Transform)
like you do.
Third, the glyph returned by FTC_Image_Cache_Lookup isn't necessarily an
outline, it really
depends on the flags you've been using to load it.
Did you check the error codes returned by all functions, as well as the
type of the FT_Glyph
you're manipulating ?
Regards,
- David Turner
- The FreeType Project (www.freetype.org)
Thanks,
Ronen.
--
View this message in context:
http://www.nabble.com/performance-on-FreeType-actions-t1387531.html#a3837814
Sent from the Freetype - Dev forum at Nabble.com.
_______________________________________________
Freetype-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype-devel
***********************************************************************************
Information contained in this email message is confidential and may be
privileged, and is intended only for use of the individual or entity named
above. If the reader of this message is not the intended recipient, or the
employee or agent responsible to deliver it to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this communication
in error, please immediately notify the address@hidden and destroy the original
message.
***********************************************************************************