Mickey Gabel | 18 Nov 10:57
Favicon

Re: [ft] Minimizing small file reads

What about loading the font completely into memory and having FT2 work 
on the loaded buffer?

suzuki toshiya wrote:
> Hi,
> 
> In the system supporting memmap() and FreeType2 is configured
> to use it, the number of system call would be much reduced in
> comparison with the system without memmap. In the target platform
> which you're working for, memmap() is available? Or, available
> and configured to use it, but you think still too many read
> system call is executed?
> 
> Regards,
> mpsuzuki
> 
> ☂Josh Chia (谢任中) wrote (2008/11/18 10:39):
>> Hi,
>>
>> I notice that freetype makes a lot of small reads, resulting in a lot of
>> SYS_read calls.  I'm using freetype in an app that runs in a ptrace 
>> sandbox,
>> so performance is sensitive to system calls.  Is there a simple way to
>> prevent the numerous small reads (via ft_ansi_stream_io), such as
>> configuring freetype to prefetch into a large buffer when reading, and
>> making it assume that font files never change?  Will I need to make some
>> configuration changes or do I need to make code changes?  Thanks!
>>
>> Josh
>>
(Continue reading)

[ft] Minimizing small file reads

Hi,

I notice that freetype makes a lot of small reads, resulting in a lot of SYS_read calls.  I'm using freetype in an app that runs in a ptrace sandbox, so performance is sensitive to system calls.  Is there a simple way to prevent the numerous small reads (via ft_ansi_stream_io), such as configuring freetype to prefetch into a large buffer when reading, and making it assume that font files never change?  Will I need to make some configuration changes or do I need to make code changes?  Thanks!

Josh

_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype
Peter Weilbacher | 30 Oct 12:44

[ft] Font broken or FreeType?

I encountered a problem with FT_Load_Glyph() using the "Helvetica Italic"
font (HELVI.PFB) that is included with OS/2. It fails for one glyph (499
starting from 0) with error code 0xa0 ("opcode syntax error"). The short
program below demonstrates it. I can easily provide the font, if needed.

Now, to find out if it's the font that is broken or FreeType just stumbles
over a quirk in a correct font, I tried to verify the problem with FontForge.
Perhaps I don't know how to properly handle that program, but it doesn't
expose any problems. (Just that FontForge seems to sort the glyphs
differently, 499 is not the one that I am trying to load, the ones around
it have different names, too).

Thanks in advance for any hints!
   Peter.

---------------------- brokenHelvI_test.c -----------------------

// sample output for broken font:
// $ brokenHelvI_test.exe HELVI.PFB 499
// 1: error=0xa0 for HELVI.PFB glyph 499
// 2: error=0xa0 for HELVI.PFB glyph 499

#include "ft2build.h"
#include FT_FREETYPE_H
#include <stdio.h>

int main(int argc, char *argv[])
{
  FT_Library ftlib;
  FT_Init_FreeType(&ftlib);

  FT_Face face;
  FT_Error error = FT_New_Face(ftlib, argv[1], 0, &face);
  if (error) {
    printf("error=0x%x loading %s\n", error, argv[1]);
    FT_Done_FreeType(ftlib);
    return 1;
  }
  error = FT_Load_Glyph(face, atoi(argv[2]), FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING |
FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM);
  if (error) {
    printf("1: error=0x%x for %s glyph %d\n", error, argv[1], atoi(argv[2]));
  }
  error = FT_Load_Glyph(face, atoi(argv[2]), FT_LOAD_DEFAULT);
  if (error) {
    printf("2: error=0x%x for %s glyph %d\n", error, argv[1], atoi(argv[2]));
  }
  FT_Done_Face(face);

  FT_Done_FreeType(ftlib);
  return 0;
}
ayoub mejri | 29 Oct 16:45

[ft] freetype question

Hello,
 
I still work with freetype cache but I have the following problem.
 
I have a text to parse that has  2 lines (first line with size 12 and second line with size 24)
 
While parsing, when I look up glyphs of the second line (size of 24), if it exist in cache (means found in first line),it is rendered with the size 12 and not 24 (I think beacause it is stored with the size of 12)
I am using always the lookup FTC_ImageCache_LookupScaler function
 
Please can you help me.
 
cdt
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype
Sivaprasad CG | 20 Oct 13:18

[ft] Freetype2 functions


Dear All,

Is there any function in freetype2, which list out all the unicodes in the
given font. 
Suppose I am opening timesnewroman.ttf, can i get all the unicode values
that are supported by this font file using the Freetype2 functions. 

Is there any function in freetype2, in which i can query a particular
unicode value in a particular font file. 

Regards
Sivan
--

-- 
View this message in context: http://www.nabble.com/Freetype2-functions-tp20067250p20067250.html
Sent from the Freetype - User mailing list archive at Nabble.com.
Hartwig Wiesmann | 12 Oct 09:02
Favicon

[ft] ftmac.c

I have found two time the file ftmac.cp in the directory structure:

  - src/base/ftmac.c
  - builds/mac/ftmac.c

The one in builds/mac seems to be older than the one in src/base but  
do I need the one in builds/mac anywhere?

Hartwig
Bob Cohen | 27 Sep 22:30
Favicon

[ft] freetype and php

I'm having trouble compiling freetype into my php. I'm running fedora  
9 with Apache 2.0.633, php 4.4.9  GD is installed.

Here's what I've got for freetype,

# rpm -qa | grep -i freetype
freetype-devel-2.3.5-4.fc9.i386
freetype-2.3.5-4.fc9.i386

This is latest version available via Yum.

Here's the config string,

# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-magic- 
quotes --enable-ftp --with-mcrypt=/usr/local --with-mysql=/usr --with- 
mhash=/usr/local/lib --with-zlib --enable-mbstring --with-gd -with-png  
--with-jpeg-dir=/usr --with-freetype --with-imap --with-kerberos -- 
with-imap-ssl --with-ttf --enable-gd-native-ttf --enable-freetype2

Configure runs without complaints.
Make clean		(no complaints)
Make 			(no complaints)
Make install 		(no complaints)
/apachect stop/start 	(no complaints)

My phpinfo script shows no freetype support???

Any help would be appreciated.

Bob Cohen
Principal, MojoTools Web Design
W:  www.mojotools.com
O:  508.384.0405
Bob Cohen | 28 Sep 00:09
Favicon

[ft] Freetype/PHP compilation woes

I'm having trouble compiling freetype into my php. I'm running fedora  
9 with Apache 2.0.633 (installed from source) , php 4.4.9 (installed  
from source)  I'm using the GD embedded with PHP.

Using Yum I have installed freetype and freetype-devel.

# rpm -qa | grep -i freetype
freetype-devel-2.3.5-4.fc9.i386
freetype-2.3.5-4.fc9.i386

This is latest version available via Yum.

Here's the config string,

# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-magic- 
quotes --enable-ftp --with-mcrypt=/usr/local --with-mysql=/usr --with- 
mhash=/usr/local/lib --with-zlib --enable-mbstring --with-gd -with-png  
--with-jpeg-dir=/usr --with-freetype --with-imap --with-kerberos -- 
with-imap-ssl --with-ttf --enable-gd-native-ttf --enable-freetype2

Configure runs without complaints.
Make clean		(no complaints)
Make 			(no complaints)
Make install 		(no complaints)
/apachect stop/start 	(no complaints)

My phpinfo script shows no freetype support???

Any help would be appreciated.

Bob Cohen
Principal, MojoTools Web Design
W:  www.mojotools.com
O:  508.384.0405
ayoub mejri | 21 Sep 16:06

[ft] freetype cache

Hello
 
Please I have a problem using freetype cache. Im a bigginner to image and C handling and I have 4 question about freetype cache.
 
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
 
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)
 
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);
 
Fourth: the cache of freetype is used to store the repeted character or all the characters in the font after making FTC_MANAGER_NEW
 
Please if you can help me as soon as possible
 
Cdt
 
 
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype

[ft] optimize executable size

Hi,

Anyone have already try to remove all unnecessary freetype code for 
following action :
 - read a ttf font file
 - read a glyph
 - read the glyph bitmap array

Note : I already remove modules from Jam file, and I'm trying to delete 
all function from .c file, but it is long ...

Best regards,
--

-- 
François Xavier Gendrin
IT Engineer
__________________________________

STORE ELECTRONIC SYSTEMS
39, rue de Montigny
95100 ARGENTEUIL - France

Tél. : + 33 1 34 34 61 61
Fax  : + 33 1 34 34 42 85
www.store-electronic-systems.com
www.ses-esl.com
Erik Möller | 17 Sep 16:53

[ft] Advanced (?) character composition

Hi,

 

I’m trying to use FT to render some nice glyphs to be used in a game I’m working on. Basically I’m trying to achieve what PhotoShop’s layer effect “stroke” (outside stroke) with a different color does.

I haven’t used FT before so after a quick foray into the docs I got a black outside stroked glyph rendered into one bitmap and a white regular glyph into another bitmap and was about to combine them when I realized they didn’t have the same dimensions. I tried the naïve implementation of blending the smaller bitmap into the larger by just centering it. That of course produced some neat results on some characters and not so neat on others where the difference in dimensions were not divisible by two.

 

I couldn’t find the answer to how to do this properly in the docs. The only two ideas I have currently is trying direct rendering hoping that the stroked glyph and regular one are in fact  centered around the same coordinates or resorting to some naïve centering with supersampling…but that sounds like a hack that will still produce incorrect results in some cases so I’d rather not have to resort to that.

 

I’m hoping I’m missing something simple from the doc, or that direct rendering is the solution.

Any feedback is appreciated.

 

/Erik

_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype

Gmane