patchThe FreeType Project - Patches: patch #9146, Provide a way to retrieve bitmap...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9146: Provide a way to retrieve bitmap metrics without memory allocation.

Submitter:  Seigo Nonaka <seigo>
Submitted:  Wed 19 Oct 2016 07:35:10 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  wl Open/Closed:  Closed

Mon 07 Nov 2016 07:20:31 AM UTC, comment #4: 

Thank you very much!
I verified the latest freetype has a FT_LOAD_BITMAP_METRICS_ONLY and it improves our product performance!

Huge thanks for your quick response!

Seigo Nonaka <seigo>
Sun 06 Nov 2016 11:53:45 AM UTC, comment #3: 

The difference in ftbench are indeed impressive!

I've massaged your code and extended it to cover all bitmap formats supported by FreeType.

Similarly, I've also improved your patch for ftbench, which unveiled a bug.  To test a bitmap-only font, you have to use the `-s N' argument with N an arbitrary value >= 0.

Please test.

Werner LEMBERG <wl>
Group administrator
Fri 04 Nov 2016 06:52:39 AM UTC, comment #2: 

Thank you for your reply and I'm sorry for slow update.

I found that ftbench in freetype2-demo is good for seeing the performance differences with small modifications.

By passing 0x400000 (FT_LOAD_BITMAP_METRICS_ONLY), FT_Load_Glyph becomes quite faster.

Attaching a patch to the ftbench.c to be able to run with bitmap font, and also attaching raw-result of ftbench on my environment.

I used NotoColorEmoji.ttf for this benchmark.
https://www.google.com/get/noto/#emoji-zsye-color


Thank you.

(file #38881, file #38882)

Seigo Nonaka <seigo>
Wed 26 Oct 2016 07:24:39 PM UTC, comment #1: 

This looks useful, thanks.  Before applying the patch, however, could you show me some that uses it?  Or even better, could you update the demo programs of FreeType (in particular ftbench) to use it?

Werner LEMBERG <wl>
Group administrator
Wed 19 Oct 2016 07:35:10 AM UTC, original submission:  

I'd like to introduce a new flag to FT_Load_Glyph for getting glyph metrics only for bitmap glyph.

FT_Load_Glyph won't generate bitmap for non bitmap glyph until the user calls FT_Render_Glyph. However, looks like it always allocates memories for bitmap and copy or decodes the contents for the bitmap glyph.

This is not ignor-able for the color bitmap glyph. Color emoji is a embedded PNG data. It allocates much memories and takes longer time to decode PNG data.

This patch introduces a new flag to FT_Load_Glyph for getting bitmap glyph metrics only. FT_LOAD_RENDER can not be usable here since stop copying bitmap data without FT_LOAD_RENDER will breaks existing applications.

Seigo Nonaka <seigo>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #38881:  ftbench.patch added by seigo (805B - text/x-patch)
file #38882:  ftbench_result.txt added by seigo (2KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by seigo (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-06 wl StatusNeed Info Done
        Open/ClosedOpen Closed
    2016-11-04 seigo Attached File- Added ftbench.patch, #38881
        Attached File- Added ftbench_result.txt, #38882
    2016-10-26 wl StatusNone Need Info
        Assigned toNone wl
    2016-10-19 seigo Attached File- Added 0001-Introduce-a-way-of-retriving-bitmap-metrics-without-.patch, #38759

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code