Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit cc4b7e6

Browse files
Harshitha Onkarprrace
Harshitha Onkar
authored andcommitted
8301998: Update HarfBuzz to 7.0.1
Backport-of: f5c8b68c1c4d8bdbf4838aafdcd657fc104420d8
1 parent 5138f5a commit cc4b7e6

File tree

267 files changed

+28223
-14922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+28223
-14922
lines changed

make/modules/java.desktop/lib/Awt2dLibraries.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ else
456456
-DHB_NO_PRAGMA_GCC_DIAGNOSTIC
457457
endif
458458
ifeq ($(call isTargetOs, linux macosx), true)
459-
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
459+
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES -DHB_NO_VISIBILITY
460460
endif
461461

462462
# Early re-canonizing has to be disabled to workaround an internal XlC compiler error

src/java.desktop/share/legal/harfbuzz.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Harfbuzz v4.4.1
1+
## Harfbuzz v7.0.1
22

33
### Harfbuzz License
44

5-
https://github.com/harfbuzz/harfbuzz/blob/4.4.1/COPYING
5+
https://github.com/harfbuzz/harfbuzz/blob/7.0.1/COPYING
66

77
<pre>
88

@@ -12,21 +12,22 @@ files names COPYING in subdirectories where applicable.
1212

1313
Copyright © 2010-2022 Google, Inc.
1414
Copyright © 2018-2020 Ebrahim Byagowi
15-
Copyright © 2019-2020 Facebook, Inc.
16-
Copyright © 2012-2015 Mozilla Foundation.
17-
Copyright © 2011 Codethink Limited
18-
Copyright © 2008-2010 Nokia Corporation and/or its subsidiary(-ies)
19-
Copyright © 2009 Keith Stribley
20-
Copyright © 2009 Martin Hosken and SIL International
21-
Copyright © 2007 Chris Wilson
22-
Copyright © 2005-2022 Behdad Esfahbod
23-
Copyright © 2005 David Turner
2415
Copyright © 2004-2013 Red Hat, Inc.
25-
Copyright © 1998-2004 David Turner and Werner Lemberg
26-
Copyright © 2016 Elie Roux <elie.roux@telecom-bretagne.eu>
16+
Copyright © 2019 Facebook, Inc.
17+
Copyright © 2007 Chris Wilson
2718
Copyright © 2018-2019 Adobe Inc.
19+
Copyright © 2006-2023 Behdad Esfahbod
20+
Copyright © 1998-2004 David Turner and Werner Lemberg
21+
Copyright © 2009 Keith Stribley
2822
Copyright © 2018 Khaled Hosny
23+
Copyright © 2016 Elie Roux <elie.roux@telecom-bretagne.eu>
2924
Copyright © 2016 Igalia S.L.
25+
Copyright © 2015 Mozilla Foundation.
26+
Copyright © 1999 David Turner
27+
Copyright © 2005 Werner Lemberg
28+
Copyright © 2013-2015 Alexei Podtelezhnikov
29+
Copyright © 2022 Matthias Clasen
30+
Copyright © 2011 Codethink Limited
3031

3132
For full copyright notices consult the individual files in the package.
3233

@@ -72,3 +73,23 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
7273
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7374

7475
</pre>
76+
77+
### AUTHORS File Information
78+
```
79+
80+
Behdad Esfahbod
81+
David Corbett
82+
David Turner
83+
Ebrahim Byagowi
84+
Garret Rieger
85+
Jonathan Kew
86+
Khaled Hosny
87+
Lars Knoll
88+
Martin Hosken
89+
Owen Taylor
90+
Roderick Sheeter
91+
Roozbeh Pournader
92+
Simon Hausmann
93+
Werner Lemberg
94+
95+
```

src/java.desktop/share/native/libharfbuzz/hb-ot-color-cbdt-table.hh renamed to src/java.desktop/share/native/libharfbuzz/OT/Color/CBDT/CBDT.hh

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
* Google Author(s): Seigo Nonaka, Calder Kitagawa
2525
*/
2626

27-
#ifndef HB_OT_COLOR_CBDT_TABLE_HH
28-
#define HB_OT_COLOR_CBDT_TABLE_HH
27+
#ifndef OT_COLOR_CBDT_CBDT_HH
28+
#define OT_COLOR_CBDT_CBDT_HH
2929

30-
#include "hb-open-type.hh"
30+
#include "../../../hb-open-type.hh"
31+
#include "../../../hb-paint.hh"
3132

3233
/*
3334
* CBLC -- Color Bitmap Location
@@ -67,7 +68,7 @@ _copy_data_to_cbdt (hb_vector_t<char> *cbdt_prime,
6768
{
6869
unsigned int new_len = cbdt_prime->length + length;
6970
if (unlikely (!cbdt_prime->alloc (new_len))) return false;
70-
memcpy (cbdt_prime->arrayZ + cbdt_prime->length, data, length);
71+
hb_memcpy (cbdt_prime->arrayZ + cbdt_prime->length, data, length);
7172
cbdt_prime->length = new_len;
7273
return true;
7374
}
@@ -80,12 +81,15 @@ struct SmallGlyphMetrics
8081
return_trace (c->check_struct (this));
8182
}
8283

83-
void get_extents (hb_font_t *font, hb_glyph_extents_t *extents) const
84+
void get_extents (hb_font_t *font, hb_glyph_extents_t *extents, bool scale) const
8485
{
85-
extents->x_bearing = font->em_scale_x (bearingX);
86-
extents->y_bearing = font->em_scale_y (bearingY);
87-
extents->width = font->em_scale_x (width);
88-
extents->height = font->em_scale_y (-static_cast<int>(height));
86+
extents->x_bearing = bearingX;
87+
extents->y_bearing = bearingY;
88+
extents->width = width;
89+
extents->height = -static_cast<int> (height);
90+
91+
if (scale)
92+
font->scale_glyph_extents (extents);
8993
}
9094

9195
HBUINT8 height;
@@ -307,7 +311,7 @@ struct IndexSubtable
307311
}
308312
}
309313

310-
bool get_extents (hb_glyph_extents_t *extents HB_UNUSED) const
314+
bool get_extents (hb_glyph_extents_t *extents HB_UNUSED, bool scale HB_UNUSED) const
311315
{
312316
switch (u.header.indexFormat)
313317
{
@@ -468,13 +472,13 @@ struct IndexSubtableRecord
468472
if (unlikely (!c->serializer->check_success (records->resize (records->length + 1))))
469473
return_trace (false);
470474

471-
(*records)[records->length - 1].firstGlyphIndex = 1;
472-
(*records)[records->length - 1].lastGlyphIndex = 0;
475+
records->tail ().firstGlyphIndex = 1;
476+
records->tail ().lastGlyphIndex = 0;
473477
bitmap_size_context->size += IndexSubtableRecord::min_size;
474478

475479
c->serializer->push ();
476480

477-
if (unlikely (!add_new_subtable (c, bitmap_size_context, &((*records)[records->length - 1]), lookup, base, start)))
481+
if (unlikely (!add_new_subtable (c, bitmap_size_context, &(records->tail ()), lookup, base, start)))
478482
{
479483
c->serializer->pop_discard ();
480484
c->serializer->revert (snap);
@@ -504,8 +508,8 @@ struct IndexSubtableRecord
504508
return num_missing;
505509
}
506510

507-
bool get_extents (hb_glyph_extents_t *extents, const void *base) const
508-
{ return (base+offsetToSubtable).get_extents (extents); }
511+
bool get_extents (hb_glyph_extents_t *extents, const void *base, bool scale) const
512+
{ return (base+offsetToSubtable).get_extents (extents, scale); }
509513

510514
bool get_image_data (unsigned int gid,
511515
const void *base,
@@ -833,15 +837,15 @@ struct CBDT
833837
}
834838

835839
bool
836-
get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const
840+
get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents, bool scale = true) const
837841
{
838842
const void *base;
839843
const BitmapSizeTable &strike = this->cblc->choose_strike (font);
840844
const IndexSubtableRecord *subtable_record = strike.find_table (glyph, cblc, &base);
841845
if (!subtable_record || !strike.ppemX || !strike.ppemY)
842846
return false;
843847

844-
if (subtable_record->get_extents (extents, base))
848+
if (subtable_record->get_extents (extents, base, scale))
845849
return true;
846850

847851
unsigned int image_offset = 0, image_length = 0, image_format = 0;
@@ -858,26 +862,29 @@ struct CBDT
858862
if (unlikely (image_length < GlyphBitmapDataFormat17::min_size))
859863
return false;
860864
auto &glyphFormat17 = StructAtOffset<GlyphBitmapDataFormat17> (this->cbdt, image_offset);
861-
glyphFormat17.glyphMetrics.get_extents (font, extents);
865+
glyphFormat17.glyphMetrics.get_extents (font, extents, scale);
862866
break;
863867
}
864868
case 18: {
865869
if (unlikely (image_length < GlyphBitmapDataFormat18::min_size))
866870
return false;
867871
auto &glyphFormat18 = StructAtOffset<GlyphBitmapDataFormat18> (this->cbdt, image_offset);
868-
glyphFormat18.glyphMetrics.get_extents (font, extents);
872+
glyphFormat18.glyphMetrics.get_extents (font, extents, scale);
869873
break;
870874
}
871875
default: return false; /* TODO: Support other image formats. */
872876
}
873877

874878
/* Convert to font units. */
875-
float x_scale = upem / (float) strike.ppemX;
876-
float y_scale = upem / (float) strike.ppemY;
877-
extents->x_bearing = roundf (extents->x_bearing * x_scale);
878-
extents->y_bearing = roundf (extents->y_bearing * y_scale);
879-
extents->width = roundf (extents->width * x_scale);
880-
extents->height = roundf (extents->height * y_scale);
879+
if (scale)
880+
{
881+
float x_scale = upem / (float) strike.ppemX;
882+
float y_scale = upem / (float) strike.ppemY;
883+
extents->x_bearing = roundf (extents->x_bearing * x_scale);
884+
extents->y_bearing = roundf (extents->y_bearing * y_scale);
885+
extents->width = roundf (extents->width * x_scale);
886+
extents->height = roundf (extents->height * y_scale);
887+
}
881888

882889
return true;
883890
}
@@ -934,6 +941,32 @@ struct CBDT
934941

935942
bool has_data () const { return cbdt.get_length (); }
936943

944+
bool paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const
945+
{
946+
hb_glyph_extents_t extents;
947+
hb_glyph_extents_t pixel_extents;
948+
hb_blob_t *blob = reference_png (font, glyph);
949+
950+
if (unlikely (blob == hb_blob_get_empty ()))
951+
return false;
952+
953+
if (unlikely (!hb_font_get_glyph_extents (font, glyph, &extents)))
954+
return false;
955+
956+
if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
957+
return false;
958+
959+
bool ret = funcs->image (data,
960+
blob,
961+
pixel_extents.width, -pixel_extents.height,
962+
HB_PAINT_IMAGE_FORMAT_PNG,
963+
font->slant_xy,
964+
&extents);
965+
966+
hb_blob_destroy (blob);
967+
return ret;
968+
}
969+
937970
private:
938971
hb_blob_ptr_t<CBLC> cblc;
939972
hb_blob_ptr_t<CBDT> cbdt;
@@ -994,4 +1027,4 @@ struct CBDT_accelerator_t : CBDT::accelerator_t {
9941027

9951028
} /* namespace OT */
9961029

997-
#endif /* HB_OT_COLOR_CBDT_TABLE_HH */
1030+
#endif /* OT_COLOR_CBDT_CBDT_HH */

0 commit comments

Comments
 (0)