freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] freetype cache


From: Brady Duga
Subject: Re: [ft] freetype cache
Date: Sun, 21 Sep 2008 08:24:04 -0700


On Sep 21, 2008, at 7:08 AM, ayoub mejri wrote:

First: I dont understand the parameter max_bytes of the function FTC_Manager_New Whene I set maw_bytes to 0, some character are not displayed, whene it is 2000 more character are displayed and whene it is 3000 a few character are displayed
I would like to know which value must be set to max_bytes

0 should be fine. I have used that value in the past and it does seem to set the defaults correctly. You can also set it to be a larger value (2000 and 3000 seem small). Since this represents the total size of the entire cache for everything you might store in it, try something closer to a MB (I use 2000000). Of course, it depends on what you are caching, so you may need to tweak the values to get the best performance/memory use trade-off. As to why some characters are not displayed - I don't know. I use the cache system with no problems. Perhaps there is some other problem in your code...


Second: I would like to understand the meaning of the third parameters of the function FTC_CMapCache_Lookup, (cmap_index), and if it is the same as the second of FT_Select_Charmap, (encoding)

I think the is the same index as used in the various charmap routines (like FT_Get_Charmap_Index).


Third :I use the function FT_Outline_Embolden(face->glyph->outline, 1 << 6); after making FT_Load_Glyph (it display correctly) but whene I use the cache subsytem I makeFTC_Manager_LookupFace( cache_man,font_type.face_id,aface );then FTC_ImageCache_Lookup(image_cache, &font_type, glyph_index, &glyph, NULL); the I make FT_Outline_Embolden(*aface->glyph->outline, 1 << 6); , but nothing is embolded: Please can you give some lines explaining how to make the algorithme and the same as FT_GlyphSlot_Oblique(*aface->glyph);

No clue. The docs do say you shouldn't transform the glyph after loading it, as it is owned by the cache subsystem, so I would expect multiple emboldens to make the glyph even bolder. What flags are you setting on font_type? If you are passing render (which makes sense if you are caching), then I doubt embolden can work.


Fourth: the cache of freetype is used to store the repeted character or all the characters in the font after making FTC_MANAGER_NEW

It caches all the characters it can fit in the space you told it (and up to the various max settings you supplied) that are accessed from the cache system. So, anything loaded from FTC_ImageCache_Lookup is cached. If necessary, other data will be purged from the cache to make room for the glyph you just loaded.

Hope that helps. I don't know much about the internals of the cache system, but I am using it successfully and have found it to work quite well.

--Brady




reply via email to

[Prev in Thread] Current Thread [Next in Thread]