bugThe FreeType Project - Bugs: bug #54852, HarfBuzz deprecation of...

 
 

bug #54852: HarfBuzz deprecation of hb_ot_tags_from_script breaks afshaper.c compilation

Submitted by:  Dominik Röttsches <drott>
Submitted on:  Wed 17 Oct 2018 08:38:00 AM UTC  
 
Severity:  3 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None 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 01 Nov 2018 03:45:31 PM UTC, comment #4: 

The actual value of HB_OT_MAX_TAGS_PER_SCRIPT shouldn't matter much, if it changes the worst that can happen is that you miss one of the possible tags. If you're concerned about possibly missing a tag then check if the returned count is greater than when it was passed in, reserve some more space, and call again. See documentation at [1]. Note that the documentation uses the term 'tags retrieved' to mean all possible tags (not capped by the original count passed in).

[1] https://github.com/harfbuzz/harfbuzz/blob/07ec792212063851ee41eae33792d3d90d31e6a1/src/hb-ot-tag.cc#L323

bungeman <bungeman>
Fri 19 Oct 2018 08:58:03 PM UTC, comment #3: 

is HB_OT_MAX_TAGS_PER_SCRIPT a frozen value? I am worried about that change which breaks harfbuzz or freetype or both, when the compiled-time header is not the same as a runtime versions. (i.e. you build freetype, then upgrade harfbuzz, or vice versa).

Hin-Tak Leung <htl10>
Wed 17 Oct 2018 05:19:13 PM UTC, comment #2: 

You can also do:

diff --git a/src/autofit/afshaper.c b/src/autofit/afshaper.c
index 486d7133c..ca7866ebe 100644
--- a/src/autofit/afshaper.c
+++ b/src/autofit/afshaper.c
@@ -111,10 +111,8 @@

     hb_script_t      script;
     const hb_tag_t*  coverage_tags;
-    hb_tag_t         script_tags[] = { HB_TAG_NONE,
-                                       HB_TAG_NONE,
-                                       HB_TAG_NONE,
-                                       HB_TAG_NONE };
+    hb_tag_t         script_tags[HB_OT_MAX_TAGS_PER_SCRIPT + 1] = { HB_TAG_NONE };
+    unsigned         num_returned_script_tags = sizeof(script_tags) / sizeof(script_tags[0]) - 1;

Behdad Esfahbod <behdad>
Wed 17 Oct 2018 08:39:01 AM UTC, comment #1: 

Behdad, perhaps you can take a comment on whether the attached patch makes sense.

Dominik Röttsches <drott>
Wed 17 Oct 2018 08:38:00 AM UTC, original submission:  

HarfBuzz is deprecating hb_ot_tags_from_script in
https://github.com/harfbuzz/harfbuzz/commit/8061664ad1a5933098adc3bc1dca0b5be48586ef

Consider changing the call to to hb_ot_tags_from_script with hb_ot_tags_from_script_and_language, similar to attached patch.

Dominik Röttsches <drott>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45217:  ft_afshaper_hb_ot_tags.patch added by drott (1KiB - application/octet-stream - Sketch / fix proposal)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bungeman (Posted a comment)
  • -email is unavailable- added by htl10 (Posted a comment)
  • -email is unavailable- added by behdad (Posted a comment)
  • -email is unavailable- added by drott (Submitted the item)
  • -email is unavailable- added by drott
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-17 drott Attached File- => Added ft_afshaper_hb_ot_tags.patch, #45217
        Carbon-Copy- => Added behdad@google.com

    Back to the top


    Powered by Savane 3.5