Hello Jacques,

I think yes, you need to manage bitmap buffer of your own while rendering. By 
static resource what I mean is to generate compilable bitmap resource file. To 
make it clear, writing  steps to get it done  -

1. Developing a font tool using freetype libs for bitmap generation. For bitmap 
generation, this tool will work in offline mode i.e. having no interface with 
your renderer. 

2. Each bitmap resource file generated will be carrying single size bitmap 
font. 
3. For example, if target language is being C, your bitmap resource file will 
be as verdana_bold_18_size.c 
4. This .c file would contain bitmaps array for Latin chars from Unicode 0x00 
to 0xFF.
5. Later this .c would be accessed by renderer code for rendering glyphs using 
index scheme. 
6. If your renderer is capable of pixel level rendering, freetype can be 
eliminated from loop.


 Since, fonts are generated in offline mode, freetype resource's memory issue 
no longer exists. Only limitations with this procedure is that, you need to 
finalize number of fonts and their sizes in advance for later use in renderer 
code.

I hope this will work for you. :)


Regards 
Govind

-----Original Message-----
From: "Jacques Beaumont" <[email protected]>
Sent: ‎06-‎11-‎2013 08:01 PM
To: "[email protected]" <[email protected]>; "[email protected]" 
<[email protected]>
Subject: RE: [ft] Management of resources for bitmap

Govind,


         Thanks for the prompt reply.


          By statically I believe you mean generating an atlas
          of characters and have a bitmap for each. Well If I am working
          with multiple fonts, of multiple size that can consume a large

          amount of resources.


          I believe that if I can avoid having Free Type allocating
resources each
          time a characater is rendered, I can have both flexibility and
performance. 
          The fonts can be render quite quickly, and I need to render
them only when 
          I change my annotation. Once rendered they are in the texture
buffer and can be
          added to the graphs quite rapidly.


          So, I believe, the only thing I need to do is the ability to
assign (or manage) myself the 
          bitmap buffer.


Thanks again,
Jacques      


          

Jacques Beaumont Ph.D.
Visiting Professor
Department of Pharmacology
Upstate Medical University of SUNY
Adjunct Associate Professor 
Department of Biomedical and Chemical Engineering 
Syracuse University

Phone: 315-464-8007
>>> Govind  11/06/13 1:12 AM >>>
You can try with generating bitmap statically in one go in the format
compatible with language you are using. Later, this generated bitmaps
resources can be used using index access mapped with string Unicode
chars. 

Regards 
Govind

-----Original Message-----
From: "Jacques Beaumont" 
Sent: ‎05-‎11-‎2013 10:18 PM
To: "[email protected]" 
Subject: [ft] Management of resources for bitmap

First congratulation to the developers. The Free type
  library is just a wonderful resource.

   I'd like to manage memory in glyph to bitmap conversion
   in order to optimize performance. I may miss something but 
   I could not find a routine to do that.

   Here is the context. 
   I am developing a graphic front end interface which requires
annotation,
   essentially small string <128 chars, that I send to the graphic
engine
   through the texture buffer.

   Now in order to preserve flexibility e.g. rendering fonts of
different size and color
   I'd like to proceed this way. Load in memory the font file, scan my
strings, render
   them in a memory buffer large enough to accomodate any given string
and then 
   load the rendered string in the texture buffer for later placement on
graphics.

    I can do all this, but I cannot manage memory resources for bitmap.
The FT_Render_Glyph
    routine allocates memory for each bit map and does not let me assign
my own resources.
    the FT_Outline_Render allows me to memory management, but I could
never get it to work well
    when I mix different types of fonts and size (need for
subscript/superscript and mixing greek and latin
    letters). I'd like to use the render used by FT_Render_Glyph and
manage the resources myself

    Any suggestions??



Sincerely,
Jacques






Jacques Beaumont Ph.D.
Visiting Professor
Department of Pharmacology
Upstate Medical University of SUNY
Adjunct Associate Professor 
Department of Biomedical and Chemical Engineering 
Syracuse University

Phone: 315-464-8007

_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype


_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to