Hi,

  [NSFont coveredCharacterSet] is broken.
  I attach a patch.
  A quick test shows that a Chinese font which contains 25,000+ glyph
  takes only about 1-2 seconds to go through.
  It's on a powerbook G4 1GHz.
  So cache may not be needed for coveredCharacterSet.
  I haven't test the preferredFont yet.
  Hope this patch can go in soon.

  Yen-Ju

On 8/9/07, Yen-Ju Chen <[EMAIL PROTECTED]> wrote:
> On 8/9/07, Fred Kiefer <[EMAIL PROTECTED]> wrote:
> > Yen-Ju Chen wrote:
> > > On 8/8/07, Fred Kiefer <[EMAIL PROTECTED]> wrote:
> > >> Yen-Ju Chen wrote:
> > >>>   Another thing I am thinking is to save the coveredCharacterSet on 
> > >>> disk.
> > >>>   Font does not change frequently,
> > >>>   and it does take time to generate coveredCharacterSet for each font,
> > >>>   especially for CJK.
> > >>>   If the cached coveredCharacterSet can be saved on disk and loaded 
> > >>> later,
> > >>>   it can reduce the overhead of starting an application.
> > >>>   For art backend, it can even pack the saved coveredCharacterSet in 
> > >>> nfont.
> > >>>   So for small font, it is fine to check the covered character each 
> > >>> time.
> > >>>   For big font, saved character set is better.
> > >>>
> > >> Great idea! Would you like to work on that?
> > >
> > >   If the patch you have goes into the -trunk,
> > >   I can play with it and see how much it effects the speed
> > >   and decide what's the best way to do the cache if needed.
> > >
> >
> > I just committed this change, now it is your turn :-)
>
>   Thanx. I will take a look shortly.
>
>   Yen-Ju
>
> >
>
Index: Source/art/ftfont.m
===================================================================
--- Source/art/ftfont.m	(revision 25384)
+++ Source/art/ftfont.m	(working copy)
@@ -891,7 +891,7 @@
           NSRange	range;
 	  
 	  range.location = charcode;
-	  range.length = 0;
+	  range.length = 1;
 
 	  while (glyphindex != 0)
 	    {
@@ -904,7 +904,7 @@
 	        {
 	          [m addCharactersInRange: range];
 		  range.location = charcode;
-		  range.length = 0;
+		  range.length = 1;
 		}
 	      charcode = FT_Get_Next_Char(face, charcode, &glyphindex);
 	    }
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to