bugThe FreeType Project - Bugs: bug #46326, Further improve documentation of...

 
 

bug #46326: Further improve documentation of `FT_Get_MM_Var'.

Submitted by:  bungeman <bungeman>
Submitted on:  Thu 29 Oct 2015 08:14:37 PM UTC  
 
Severity: 3 - NormalItem Group: Wishlist
Status: ConfirmedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Open
Planned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 11 Feb 2016 06:22:24 AM UTC, comment #4:

Any progress?

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sat 31 Oct 2015 05:41:59 AM UTC, comment #3:

For consistency with the current API, I vote for option 2, taking an `FT_Library' parameter (BTW, you probably mean `FT_Bitmap_Done' instead of `FT_Stroker_Done', since the latter doesn't have a second argument). By the same token, the new function names should be then `FT_MM_Var_New' and `FT_MM_Var_Done', respectively.

Thanks for looking into this!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Fri 30 Oct 2015 10:37:13 PM UTC, comment #2:

There is an issue with implementing FT_Done_MM_Var in the 'straight forward' way, which is that there is currently no pointer from the FT_MM_Var to an FT_Memory. The options appear to be:

1. Put a pointer to an FT_Memory at the end of the FT_MM_Var allocation and use that. This doesn't work well with shutdown, as now the FT_MM_Var lifetime is tied to the FT_Memory lifetime, but this isn't very clear.

2. Require either the FT_Face or FT_Library to be passed into FT_Done_MM_Var. This is somewhat like FT_Outline_Done or FT_Stroker_Done, but it seems a bit awkward.

3. Create a different sort of interface which puts the FT_MM_Var into a slot on the FT_Face. This means adding overhead to FT_Face though.

4. Create a different interface like FT_Load_Sfnt_Table, since FT_MM_Var's structure is quite similar to that of TT_HoriHeader.

Any of these seem better than the current situation. Let me know if you have a preference.

bungeman <bungeman>
Fri 30 Oct 2015 07:11:34 AM UTC, comment #1:

Nice idea! Can you provide a patch for an `FT_Done_MM_Var' function, together with the documentation?

BTW, I don't mind renaming `FT_Get_MM_Var' to `FT_New_MM_Var', providing an alias for the old name. We've done that already in the past.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 29 Oct 2015 08:14:37 PM UTC, original submission:

Recently, the documentation for FT_Get_MM_Var was updated to state that the user must deallocate the returned pointer with 'free'. This is true, but I think somewhat misleading, as this 'free' is the 'free' on the FT_Library's FT_Memory. This is usually the c library 'free', but if a different FT_Free_Func was specified on the FT_Memory passed to FT_New_Library, then it should be that one which is called.

The amount of documentation this requires is a bit much. It would be nice if (like all other allocations made by FreeType) if there were a FT_Done_MM_Var. Then the documentation could just note "Use FT_Done_MM_Var to destroy the created FT_MM_Var object".

It is unfortunate that this is named 'Get' instead of 'New'.

bungeman <bungeman>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 30 Oct 2015 07:11:34 AM UTCwlStatusNone=>Confirmed
      Assigned toNone=>wl

    Back to the top


    Powered by Savane 3.1-cleanup1